Remove references to Sparkle
This commit is contained in:
parent
5741bad918
commit
2a7244a366
1 changed files with 49 additions and 51 deletions
|
@ -4,9 +4,7 @@
|
||||||
|
|
||||||
#include "browser/auto_updater.h"
|
#include "browser/auto_updater.h"
|
||||||
|
|
||||||
// Sparkle's headers are throwing compilation warnings, supress them.
|
#import <Squirrel/Squirrel.h>
|
||||||
#pragma GCC diagnostic ignored "-Wmissing-method-return-type"
|
|
||||||
#import <Sparkle/Sparkle.h>
|
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
@ -28,82 +26,82 @@ typedef scoped_ptr<NSInvocation, NSInvocationDeleter> ScopedNSInvocation;
|
||||||
// We are passing the NSInvocation as scoped_ptr, because we want to make sure
|
// We are passing the NSInvocation as scoped_ptr, because we want to make sure
|
||||||
// whether or not the callback is called, the NSInvocation should always be
|
// whether or not the callback is called, the NSInvocation should always be
|
||||||
// released, the only way to ensure it is to use scoped_ptr.
|
// released, the only way to ensure it is to use scoped_ptr.
|
||||||
void CallNSInvocation(ScopedNSInvocation invocation) {
|
// void CallNSInvocation(ScopedNSInvocation invocation) {
|
||||||
[invocation.get() invoke];
|
// [invocation.get() invoke];
|
||||||
}
|
// }
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@interface SUUpdaterDelegate : NSObject {
|
// @interface SUUpdaterDelegate : NSObject {
|
||||||
}
|
// }
|
||||||
@end
|
// @end
|
||||||
|
//
|
||||||
@implementation SUUpdaterDelegate
|
// @implementation SUUpdaterDelegate
|
||||||
|
//
|
||||||
- (BOOL)updater:(SUUpdater*)updater
|
// - (BOOL)updater:(SUUpdater*)updater
|
||||||
shouldPostponeRelaunchForUpdate:(SUAppcastItem*)update
|
// shouldPostponeRelaunchForUpdate:(SUAppcastItem*)update
|
||||||
untilInvoking:(NSInvocation*)invocation {
|
// untilInvoking:(NSInvocation*)invocation {
|
||||||
AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate();
|
// AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate();
|
||||||
if (!delegate)
|
// if (!delegate)
|
||||||
return NO;
|
// return NO;
|
||||||
|
//
|
||||||
std::string version(base::SysNSStringToUTF8([update versionString]));
|
// std::string version(base::SysNSStringToUTF8([update versionString]));
|
||||||
ScopedNSInvocation invocation_ptr([invocation retain]);
|
// ScopedNSInvocation invocation_ptr([invocation retain]);
|
||||||
delegate->WillInstallUpdate(
|
// delegate->WillInstallUpdate(
|
||||||
version,
|
// version,
|
||||||
base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass())));
|
// base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass())));
|
||||||
|
//
|
||||||
return YES;
|
// return YES;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
- (void)updater:(SUUpdater*)updater
|
// - (void)updater:(SUUpdater*)updater
|
||||||
willInstallUpdateOnQuit:(SUAppcastItem*)update
|
// willInstallUpdateOnQuit:(SUAppcastItem*)update
|
||||||
immediateInstallationInvocation:(NSInvocation*)invocation {
|
// immediateInstallationInvocation:(NSInvocation*)invocation {
|
||||||
AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate();
|
// AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate();
|
||||||
if (!delegate)
|
// if (!delegate)
|
||||||
return;
|
// return;
|
||||||
|
//
|
||||||
std::string version(base::SysNSStringToUTF8([update versionString]));
|
// std::string version(base::SysNSStringToUTF8([update versionString]));
|
||||||
ScopedNSInvocation invocation_ptr([invocation retain]);
|
// ScopedNSInvocation invocation_ptr([invocation retain]);
|
||||||
delegate->ReadyForUpdateOnQuit(
|
// delegate->ReadyForUpdateOnQuit(
|
||||||
version,
|
// version,
|
||||||
base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass())));
|
// base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass())));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@end
|
// @end
|
||||||
|
|
||||||
namespace auto_updater {
|
namespace auto_updater {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::Init() {
|
void AutoUpdater::Init() {
|
||||||
SUUpdaterDelegate* delegate = [[SUUpdaterDelegate alloc] init];
|
// SUUpdaterDelegate* delegate = [[SUUpdaterDelegate alloc] init];
|
||||||
[[SUUpdater sharedUpdater] setDelegate:delegate];
|
// [[SUUpdater sharedUpdater] setDelegate:delegate];
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::SetFeedURL(const std::string& url) {
|
void AutoUpdater::SetFeedURL(const std::string& url) {
|
||||||
NSString* url_str(base::SysUTF8ToNSString(url));
|
// NSString* url_str(base::SysUTF8ToNSString(url));
|
||||||
[[SUUpdater sharedUpdater] setFeedURL:[NSURL URLWithString:url_str]];
|
// [[SUUpdater sharedUpdater] setFeedURL:[NSURL URLWithString:url_str]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::SetAutomaticallyChecksForUpdates(bool yes) {
|
void AutoUpdater::SetAutomaticallyChecksForUpdates(bool yes) {
|
||||||
[[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:yes];
|
// [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:yes];
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::SetAutomaticallyDownloadsUpdates(bool yes) {
|
void AutoUpdater::SetAutomaticallyDownloadsUpdates(bool yes) {
|
||||||
[[SUUpdater sharedUpdater] setAutomaticallyDownloadsUpdates:yes];
|
// [[SUUpdater sharedUpdater] setAutomaticallyDownloadsUpdates:yes];
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::CheckForUpdates() {
|
void AutoUpdater::CheckForUpdates() {
|
||||||
[[SUUpdater sharedUpdater] checkForUpdates:nil];
|
// [[SUUpdater sharedUpdater] checkForUpdates:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void AutoUpdater::CheckForUpdatesInBackground() {
|
void AutoUpdater::CheckForUpdatesInBackground() {
|
||||||
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
|
// [[SUUpdater sharedUpdater] checkForUpdatesInBackground];
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace auto_updater
|
} // namespace auto_updater
|
||||||
|
|
Loading…
Reference in a new issue