QuitAndInstall();
}
+std::string AutoUpdater::GetFeedURL() {
+ return "";
+}
+
void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
auto_updater::AutoUpdater::HeaderMap headers;
args->GetNext(&headers);
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
+ .SetMethod("getFeedURL", &auto_updater::AutoUpdater::GetFeedURL)
.SetMethod("setFeedURL", &AutoUpdater::SetFeedURL)
.SetMethod("quitAndInstall", &AutoUpdater::QuitAndInstall);
}
void OnWindowAllClosed() override;
private:
+ std::string GetFeedURL();
void SetFeedURL(const std::string& url, mate::Arguments* args);
void QuitAndInstall();
}
#if !defined(OS_MACOSX) || defined(MAS_BUILD)
+std::string AutoUpdater::GetFeedURL() {
+ return "";
+}
+
void AutoUpdater::SetFeedURL(const std::string& url,
const HeaderMap& requestHeaders) {
}
static Delegate* GetDelegate();
static void SetDelegate(Delegate* delegate);
+ static std::string GetFeedURL();
static void SetFeedURL(const std::string& url,
const HeaderMap& requestHeaders);
static void CheckForUpdates();
namespace {
bool g_update_available = false;
+std::string update_url_ = "";
}
+std::string AutoUpdater::GetFeedURL() {
+ return update_url_;
+}
+
// static
void AutoUpdater::SetFeedURL(const std::string& feed,
const HeaderMap& requestHeaders) {
if (!delegate)
return;
+ update_url_ = feed;
+
NSURL* url = [NSURL URLWithString:base::SysUTF8ToNSString(feed)];
NSMutableURLRequest* urlRequest = [NSMutableURLRequest requestWithURL:url];
return app.quit()
}
+AutoUpdater.prototype.GetFeedURL = function () {
+ return this.updateURL;
+}
+
AutoUpdater.prototype.setFeedURL = function (updateURL, headers) {
this.updateURL = updateURL
}