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. |