Skip to content

Commit

Permalink
Fix mac menu support
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Nov 2, 2018
1 parent ab4b6a5 commit 22c593f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions chrome/browser/chrome_browser_application_mac.h
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions chrome/browser/chrome_browser_application_mac.mm
Expand Up @@ -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"
Expand Down Expand Up @@ -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<AppController*>([NSApp delegate]);
[appController tryToTerminateApplication:self];
Expand Down

0 comments on commit 22c593f

Please sign in to comment.