The tryToTerminateApp is not really needed
This commit is contained in:
parent
983e1b1a70
commit
9337959f51
3 changed files with 5 additions and 11 deletions
|
@ -31,8 +31,11 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||||
- (void)terminate:(id)sender {
|
- (void)terminate:(id)sender {
|
||||||
if (shouldShutdown_ && !shouldShutdown_.Run())
|
if (shouldShutdown_ && !shouldShutdown_.Run())
|
||||||
return; // User will call Quit later.
|
return; // User will call Quit later.
|
||||||
AtomApplicationDelegate* atomDelegate = (AtomApplicationDelegate*) [NSApp delegate];
|
|
||||||
[atomDelegate tryToTerminateApp:self];
|
// We simply try to close the browser, which in turn will try to close the
|
||||||
|
// windows. Termination can proceed if all windows are closed or window close
|
||||||
|
// can be cancelled which will abort termination.
|
||||||
|
atom::Browser::Get()->Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setShutdownHandler:(base::Callback<bool()>)handler {
|
- (void)setShutdownHandler:(base::Callback<bool()>)handler {
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
base::scoped_nsobject<AtomMenuController> menu_controller_;
|
base::scoped_nsobject<AtomMenuController> menu_controller_;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tryToTerminateApp:(NSApplication*)app;
|
|
||||||
|
|
||||||
// Sets the menu that will be returned in "applicationDockMenu:".
|
// Sets the menu that will be returned in "applicationDockMenu:".
|
||||||
- (void)setApplicationDockMenu:(atom::AtomMenuModel*)model;
|
- (void)setApplicationDockMenu:(atom::AtomMenuModel*)model;
|
||||||
|
|
||||||
|
|
|
@ -87,13 +87,6 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
|
||||||
return atom::Browser::Get()->OpenFile(filename_str) ? YES : NO;
|
return atom::Browser::Get()->OpenFile(filename_str) ? YES : NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We simply try to close the browser, which in turn will try to close the windows.
|
|
||||||
// Termination can proceed if all windows are closed or window close can be cancelled
|
|
||||||
// which will abort termination.
|
|
||||||
- (void)tryToTerminateApp:(NSApplication*)app {
|
|
||||||
atom::Browser::Get()->Quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)applicationShouldHandleReopen:(NSApplication*)theApplication
|
- (BOOL)applicationShouldHandleReopen:(NSApplication*)theApplication
|
||||||
hasVisibleWindows:(BOOL)flag {
|
hasVisibleWindows:(BOOL)flag {
|
||||||
atom::Browser* browser = atom::Browser::Get();
|
atom::Browser* browser = atom::Browser::Get();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue