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

Unified Diff: chrome/browser/browser.cc

Issue 2866034: Refactor shutdown code to allow win/linux to run after last browser closes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Uploaded patch that resolves merge issue Created 10 years, 5 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/background_contents_service_unittest.cc ('k') | chrome/browser/browser_init.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 51c77643ad4c823a57080ed6812f5eba89b66acf..3ad027607d02afa1c170aa13748684664ba9e69a 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -808,13 +808,12 @@ void Browser::OnWindowClosing() {
bool exiting = false;
-#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
+ // Application should shutdown on last window close if the user is explicitly
+ // trying to quit, or if there is nothing keeping the browser alive (such as
+ // AppController on the Mac, or BackgroundContentsService for background
+ // pages).
+ bool should_quit_if_last_browser =
+ browser_shutdown::IsTryingToQuit() || !BrowserList::WillKeepAlive();
if (should_quit_if_last_browser && BrowserList::size() == 1) {
browser_shutdown::OnShutdownStarting(browser_shutdown::WINDOW_CLOSE);
« no previous file with comments | « chrome/browser/background_contents_service_unittest.cc ('k') | chrome/browser/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698