summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 20:16:54 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 20:16:54 +0000
commit7063140edd3040e56471003698be96509501f2c9 (patch)
tree7b91c1b7631ec43b3d607f1834d0460c9877a1cf /chrome/browser/app_controller_mac.mm
parentdc9d17aa9cdc62dad4115edc7bd4a3d7708707c0 (diff)
downloadchromium_src-7063140edd3040e56471003698be96509501f2c9.zip
chromium_src-7063140edd3040e56471003698be96509501f2c9.tar.gz
chromium_src-7063140edd3040e56471003698be96509501f2c9.tar.bz2
[Mac] Ignore rapp events when the browser is shutting down.
BUG=42430 TEST=Suspected test case is to click on the dock icon immediately after quitting, but before the quit has finished. This is very timing-dependent, and I have never actually been able to reproduce the crash. Review URL: http://codereview.chromium.org/1796001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index b24cf84..c215d9c 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -786,6 +786,12 @@ void RecordLastRunAppBundlePath() {
// behavior, we should open a new window.
- (BOOL)applicationShouldHandleReopen:(NSApplication*)theApplication
hasVisibleWindows:(BOOL)flag {
+ // If the browser is currently trying to quit, don't do anything and return NO
+ // to prevent AppKit from doing anything.
+ // TODO(rohitrao): Remove this code when http://crbug.com/40861 is resolved.
+ if (browser_shutdown::IsTryingToQuit())
+ return NO;
+
// Don't do anything if there are visible windows. This will cause
// AppKit to unminimize the most recently minimized window.
if (flag)