QuitAndInstall();
}
+void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
+ auto_updater::AutoUpdater::HeaderMap headers;
+ args->GetNext(&headers);
+ auto_updater::AutoUpdater::SetFeedURL(url, headers);
+}
+
void AutoUpdater::QuitAndInstall() {
// If we don't have any window then quitAndInstall immediately.
WindowList* window_list = WindowList::GetInstance();
void AutoUpdater::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
- .SetMethod("_setFeedURL", &auto_updater::AutoUpdater::SetFeedURL)
.SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
+ .SetMethod("setFeedURL", &AutoUpdater::SetFeedURL)
.SetMethod("quitAndInstall", &AutoUpdater::QuitAndInstall);
}
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/auto_updater.h"
#include "atom/browser/window_list_observer.h"
+#include "native_mate/arguments.h"
#include "native_mate/handle.h"
namespace atom {
void OnWindowAllClosed() override;
private:
+ void SetFeedURL(const std::string& url, mate::Arguments* args);
void QuitAndInstall();
DISALLOW_COPY_AND_ASSIGN(AutoUpdater);
### `autoUpdater.setFeedURL(url[, requestHeaders])`
* `url` String
-* `requestHeaders` Object - HTTP request headers (_OS X_)
+* `requestHeaders` Object _OS X_ - HTTP request headers.
Sets the `url` and initialize the auto updater.
Object.setPrototypeOf(autoUpdater, EventEmitter.prototype)
-autoUpdater.setFeedURL = function (url, headers) {
- return autoUpdater._setFeedURL(url, headers || {})
-}
-
module.exports = autoUpdater