#include "atom/browser/browser.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
+#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
const std::string& release_name,
const base::Time& release_date,
const std::string& url) {
- Emit("update-downloaded", release_notes, release_name, release_date, url);
+ Emit("update-downloaded", release_notes, release_name, release_date, url,
+ // Keep compatibility with old APIs.
+ base::Bind(&AutoUpdater::QuitAndInstall, base::Unretained(this)));
}
void AutoUpdater::OnWindowAllClosed() {
* `releaseName` String
* `releaseDate` Date
* `updateUrl` String
-* `quitAndUpdate` Function
-Emitted when an update has been downloaded. Calling `quitAndUpdate()` will
-restart the application and install the update.
+Emitted when an update has been downloaded.
## Methods
* `url` String
-Set the `url` and initialize the auto updater. The `url` cannot be changed
+Sets the `url` and initialize the auto updater. The `url` cannot be changed
once it is set.
### `autoUpdater.checkForUpdates()`
-Ask the server whether there is an update. You must call `setFeedUrl` before
+Asks the server whether there is an update. You must call `setFeedUrl` before
using this API.
+
+### `autoUpdater.quitAndUpdate()`
+
+Restarts the app and install the update after it has been downloaded. It should
+only be called after `update-downloaded` has been emitted.