Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6425)

Unified Diff: chrome/browser/browser.cc

Issue 1520006: Mac: reform our shutdown routine. (Closed)
Patch Set: changed comment Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/browser_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 1aaef047c7399f3e2c15ada0ee4fc551fcadc0ab..74c5e1070493d7e9f66dac33e50efa09b3370fb7 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -636,14 +636,18 @@ void Browser::OnWindowClosing() {
bool exiting = false;
-#if defined(OS_WIN) || defined(OS_LINUX)
- // We don't want to do this on Mac since closing all windows isn't a sign
- // that the app is shutting down.
- if (BrowserList::size() == 1) {
+#if defined(OS_MACOSX)
+ // On Mac, closing the last window isn't usually a sign that the app is
+ // shutting down.
+ bool should_quit_if_last_browser = browser_shutdown::IsTryingToQuit();
+#else
+ bool should_quit_if_last_browser = true;
+#endif
+
+ if (should_quit_if_last_browser && BrowserList::size() == 1) {
browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE);
exiting = true;
}
-#endif
// Don't use HasSessionService here, we want to force creation of the
// session service so that user can restore what was open.
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698