diff --git a/chrome/browser/chrome_browser_application_mac.h b/chrome/browser/chrome_browser_application_mac.h index 286f9da5e1bf5..9cdbe4b220b26 100644 --- a/chrome/browser/chrome_browser_application_mac.h +++ b/chrome/browser/chrome_browser_application_mac.h @@ -24,6 +24,7 @@ // application, i.e., begins a process which may lead to termination. This // method cancels that process. - (void)cancelTerminate:(id)sender; +- (void)closeAllWindowsQuit:(id)sender; // Keep track of whether windows are being cycled for use in determining whether // a Panel window can become the key window. diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm index 9e83d57314204..5fbcbf000c4d0 100644 --- a/chrome/browser/chrome_browser_application_mac.mm +++ b/chrome/browser/chrome_browser_application_mac.mm @@ -4,6 +4,8 @@ #import "chrome/browser/chrome_browser_application_mac.h" +#include "chrome/browser/apps/platform_apps/app_window_registry_util.h" + #include "base/auto_reset.h" #include "base/command_line.h" #include "base/logging.h" @@ -222,6 +224,11 @@ + (NSApplication*)sharedApplication { // the NSApplicationWillTerminateNotification to be posted, which ends the // NSApplication event loop, so final post- MessageLoop::Run() work is done // before exiting. + +- (void)closeAllWindowsQuit:(id)sender { + AppWindowRegistryUtil::CloseAllAppWindows(true); +} + - (void)terminate:(id)sender { AppController* appController = static_cast([NSApp delegate]); [appController tryToTerminateApplication:self];