Add a few more methods for AutoUpdater.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 3 Jun 2013 02:34:42 +0000 (10:34 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 3 Jun 2013 02:34:42 +0000 (10:34 +0800)
browser/auto_updater.h
browser/auto_updater_mac.mm

index 8426c03..2166d49 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef ATOM_BROWSER_AUTO_UPDATER_H_
 #define ATOM_BROWSER_AUTO_UPDATER_H_
 
+#include <string>
+
 #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:
index 3ac390d..880e796 100644 (file)
@@ -72,6 +72,12 @@ void AutoUpdater::Init() {
 }
 
 // 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];
 }
@@ -82,6 +88,11 @@ void AutoUpdater::SetAutomaticallyDownloadsUpdates(bool yes) {
 }
 
 // static
+void AutoUpdater::CheckForUpdates() {
+  [[SUUpdater sharedUpdater] checkForUpdates:[SUUpdater sharedUpdater]];
+}
+
+// static
 void AutoUpdater::CheckForUpdatesInBackground() {
   [[SUUpdater sharedUpdater] checkForUpdatesInBackground];
 }