From 2a7244a366418fe00b184a413ca50cabe88b3d36 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Mon, 20 Jan 2014 16:22:49 -0800 Subject: [PATCH] Remove references to Sparkle --- browser/auto_updater_mac.mm | 100 ++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/browser/auto_updater_mac.mm b/browser/auto_updater_mac.mm index afde309f8c7..31fb5e45bf1 100644 --- a/browser/auto_updater_mac.mm +++ b/browser/auto_updater_mac.mm @@ -4,9 +4,7 @@ #include "browser/auto_updater.h" -// Sparkle's headers are throwing compilation warnings, supress them. -#pragma GCC diagnostic ignored "-Wmissing-method-return-type" -#import +#import #include "base/bind.h" #include "base/memory/scoped_ptr.h" @@ -28,82 +26,82 @@ typedef scoped_ptr ScopedNSInvocation; // 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 // released, the only way to ensure it is to use scoped_ptr. -void CallNSInvocation(ScopedNSInvocation invocation) { - [invocation.get() invoke]; -} +// void CallNSInvocation(ScopedNSInvocation invocation) { +// [invocation.get() invoke]; +// } } // namespace -@interface SUUpdaterDelegate : NSObject { -} -@end - -@implementation SUUpdaterDelegate - -- (BOOL)updater:(SUUpdater*)updater - shouldPostponeRelaunchForUpdate:(SUAppcastItem*)update - untilInvoking:(NSInvocation*)invocation { - AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate(); - if (!delegate) - return NO; - - std::string version(base::SysNSStringToUTF8([update versionString])); - ScopedNSInvocation invocation_ptr([invocation retain]); - delegate->WillInstallUpdate( - version, - base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass()))); - - return YES; -} - -- (void)updater:(SUUpdater*)updater - willInstallUpdateOnQuit:(SUAppcastItem*)update - immediateInstallationInvocation:(NSInvocation*)invocation { - AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate(); - if (!delegate) - return; - - std::string version(base::SysNSStringToUTF8([update versionString])); - ScopedNSInvocation invocation_ptr([invocation retain]); - delegate->ReadyForUpdateOnQuit( - version, - base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass()))); -} - -@end +// @interface SUUpdaterDelegate : NSObject { +// } +// @end +// +// @implementation SUUpdaterDelegate +// +// - (BOOL)updater:(SUUpdater*)updater +// shouldPostponeRelaunchForUpdate:(SUAppcastItem*)update +// untilInvoking:(NSInvocation*)invocation { +// AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate(); +// if (!delegate) +// return NO; +// +// std::string version(base::SysNSStringToUTF8([update versionString])); +// ScopedNSInvocation invocation_ptr([invocation retain]); +// delegate->WillInstallUpdate( +// version, +// base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass()))); +// +// return YES; +// } +// +// - (void)updater:(SUUpdater*)updater +// willInstallUpdateOnQuit:(SUAppcastItem*)update +// immediateInstallationInvocation:(NSInvocation*)invocation { +// AutoUpdaterDelegate* delegate = auto_updater::AutoUpdater::GetDelegate(); +// if (!delegate) +// return; +// +// std::string version(base::SysNSStringToUTF8([update versionString])); +// ScopedNSInvocation invocation_ptr([invocation retain]); +// delegate->ReadyForUpdateOnQuit( +// version, +// base::Bind(&CallNSInvocation, base::Passed(invocation_ptr.Pass()))); +// } +// +// @end namespace auto_updater { // static void AutoUpdater::Init() { - SUUpdaterDelegate* delegate = [[SUUpdaterDelegate alloc] init]; - [[SUUpdater sharedUpdater] setDelegate:delegate]; + // SUUpdaterDelegate* delegate = [[SUUpdaterDelegate alloc] init]; + // [[SUUpdater sharedUpdater] setDelegate:delegate]; } // static void AutoUpdater::SetFeedURL(const std::string& url) { - NSString* url_str(base::SysUTF8ToNSString(url)); - [[SUUpdater sharedUpdater] setFeedURL:[NSURL URLWithString:url_str]]; + // NSString* url_str(base::SysUTF8ToNSString(url)); + // [[SUUpdater sharedUpdater] setFeedURL:[NSURL URLWithString:url_str]]; } // static void AutoUpdater::SetAutomaticallyChecksForUpdates(bool yes) { - [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:yes]; + // [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:yes]; } // static void AutoUpdater::SetAutomaticallyDownloadsUpdates(bool yes) { - [[SUUpdater sharedUpdater] setAutomaticallyDownloadsUpdates:yes]; + // [[SUUpdater sharedUpdater] setAutomaticallyDownloadsUpdates:yes]; } // static void AutoUpdater::CheckForUpdates() { - [[SUUpdater sharedUpdater] checkForUpdates:nil]; + // [[SUUpdater sharedUpdater] checkForUpdates:nil]; } // static void AutoUpdater::CheckForUpdatesInBackground() { - [[SUUpdater sharedUpdater] checkForUpdatesInBackground]; + // [[SUUpdater sharedUpdater] checkForUpdatesInBackground]; } } // namespace auto_updater