diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 17:02:50 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 17:02:50 +0000 |
commit | 7dc8c6baea151a7e803b3781f89e81c5e53ee40e (patch) | |
tree | 3f4f72ef5eae82b976657a70f188d21e77bf9cad /chrome/browser/browser_shutdown.h | |
parent | 7717e6e61a7b681d9ed351339c2850ae13b5ccb3 (diff) | |
download | chromium_src-7dc8c6baea151a7e803b3781f89e81c5e53ee40e.zip chromium_src-7dc8c6baea151a7e803b3781f89e81c5e53ee40e.tar.gz chromium_src-7dc8c6baea151a7e803b3781f89e81c5e53ee40e.tar.bz2 |
Mac: reform our shutdown routine.
Make shutdown be more like other platforms. Moreover:
- Cancelling quit from an onbeforeunload dialog shouldn't mess up the browser.
- Having quit cancelled due to a window pop up on the closure of another window
shouldn't break the browser. [With this patch, it will result in the browser
being in a quirky state in which the closure of the last browser window will
cause a quit. But the browser won't be broken.]
BUG=34384,37813,37927
TEST=See bugs.
Review URL: http://codereview.chromium.org/1520006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_shutdown.h')
-rw-r--r-- | chrome/browser/browser_shutdown.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/browser_shutdown.h b/chrome/browser/browser_shutdown.h index 49d800f..3ab2c2e 100644 --- a/chrome/browser/browser_shutdown.h +++ b/chrome/browser/browser_shutdown.h @@ -44,6 +44,22 @@ void Shutdown(); // Called at startup to create a histogram from our previous shutdown time. void ReadLastShutdownInfo(); +#if defined(OS_MACOSX) +// On Mac, closing the last window does not automatically quit the application. +// To actually quit, set a flag which makes final window closure trigger a quit. +// If the quit is aborted, then the flag should be reset (but see notes below on +// the proper way to do this, i.e., usually not using |SetTryingToQuit()|). + +// This is a low-level mutator; in general, don't call it, except from +// appropriate places in the app controller. To quit, use usual means, e.g., +// using |chrome_browser_application_mac::Terminate()|. To stop quitting, use +// |chrome_browser_application_mac::CancelTerminate()|. +void SetTryingToQuit(bool quitting); + +// General accessor. +bool IsTryingToQuit(); +#endif // OS_MACOSX + } // namespace browser_shutdown #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__ |