Get exit code from within App::OnQuit
This commit is contained in:
parent
c4389ad70f
commit
3e5caf7e54
4 changed files with 6 additions and 6 deletions
|
@ -180,8 +180,9 @@ void App::OnWindowAllClosed() {
|
|||
Emit("window-all-closed");
|
||||
}
|
||||
|
||||
void App::OnQuit(const int code) {
|
||||
Emit("quit", code);
|
||||
void App::OnQuit() {
|
||||
int exitCode = AtomBrowserMainParts::Get()->GetExitCode();
|
||||
Emit("quit", exitCode);
|
||||
|
||||
if (process_singleton_.get()) {
|
||||
process_singleton_->Cleanup();
|
||||
|
|
|
@ -42,7 +42,7 @@ class App : public AtomBrowserClient::Delegate,
|
|||
void OnBeforeQuit(bool* prevent_default) override;
|
||||
void OnWillQuit(bool* prevent_default) override;
|
||||
void OnWindowAllClosed() override;
|
||||
void OnQuit(int code) override;
|
||||
void OnQuit() override;
|
||||
void OnOpenFile(bool* prevent_default, const std::string& file_path) override;
|
||||
void OnOpenURL(const std::string& url) override;
|
||||
void OnActivate(bool has_visible_windows) override;
|
||||
|
|
|
@ -72,8 +72,7 @@ void Browser::Shutdown() {
|
|||
is_shutdown_ = true;
|
||||
is_quiting_ = true;
|
||||
|
||||
int exitCode = AtomBrowserMainParts::Get()->GetExitCode();
|
||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit(exitCode));
|
||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit());
|
||||
|
||||
if (base::MessageLoop::current()) {
|
||||
base::MessageLoop::current()->PostTask(
|
||||
|
|
|
@ -24,7 +24,7 @@ class BrowserObserver {
|
|||
virtual void OnWindowAllClosed() {}
|
||||
|
||||
// The browser is quitting.
|
||||
virtual void OnQuit(const int code) {}
|
||||
virtual void OnQuit() {}
|
||||
|
||||
// The browser has opened a file by double clicking in Finder or dragging the
|
||||
// file to the Dock icon. (OS X only)
|
||||
|
|
Loading…
Reference in a new issue