From: Cheng Zhao Date: Mon, 3 Jun 2013 02:34:42 +0000 (+0800) Subject: Add a few more methods for AutoUpdater. X-Git-Tag: v0.1.0~115 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e4d2368908e5d4549dc8978a4e45317fe3eb0d70;p=electron.git Add a few more methods for AutoUpdater. --- diff --git a/browser/auto_updater.h b/browser/auto_updater.h index 8426c031..2166d49f 100644 --- a/browser/auto_updater.h +++ b/browser/auto_updater.h @@ -5,6 +5,8 @@ #ifndef ATOM_BROWSER_AUTO_UPDATER_H_ #define ATOM_BROWSER_AUTO_UPDATER_H_ +#include + #include "base/basictypes.h" namespace auto_updater { @@ -19,8 +21,10 @@ class AutoUpdater { static void Init(); + static void SetFeedURL(const std::string& url); static void SetAutomaticallyChecksForUpdates(bool yes); static void SetAutomaticallyDownloadsUpdates(bool yes); + static void CheckForUpdates(); static void CheckForUpdatesInBackground(); private: diff --git a/browser/auto_updater_mac.mm b/browser/auto_updater_mac.mm index 3ac390da..880e7967 100644 --- a/browser/auto_updater_mac.mm +++ b/browser/auto_updater_mac.mm @@ -71,6 +71,12 @@ void AutoUpdater::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]]; +} + // static void AutoUpdater::SetAutomaticallyChecksForUpdates(bool yes) { [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:yes]; @@ -81,6 +87,11 @@ void AutoUpdater::SetAutomaticallyDownloadsUpdates(bool yes) { [[SUUpdater sharedUpdater] setAutomaticallyDownloadsUpdates:yes]; } +// static +void AutoUpdater::CheckForUpdates() { + [[SUUpdater sharedUpdater] checkForUpdates:[SUUpdater sharedUpdater]]; +} + // static void AutoUpdater::CheckForUpdatesInBackground() { [[SUUpdater sharedUpdater] checkForUpdatesInBackground];