summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_list.h
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 21:12:57 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 21:12:57 +0000
commitbc63a07355d1e7f57aaad72ef2b2b8359637c55d (patch)
treeff5fbfa2e0d8586a692268be18a60e1827c21179 /chrome/browser/ui/browser_list.h
parent4c79b45fb6ebeebf308e2286811a714ac1c2fc07 (diff)
downloadchromium_src-bc63a07355d1e7f57aaad72ef2b2b8359637c55d.zip
chromium_src-bc63a07355d1e7f57aaad72ef2b2b8359637c55d.tar.gz
chromium_src-bc63a07355d1e7f57aaad72ef2b2b8359637c55d.tar.bz2
Don't set exit_cleanly bit early if shutdown can be canceled.
Cleanups: Added Browser::Restart. Moved code around to reduce if/defs. Updated the comment of APP_EXITING to emphasize the difference from APP_TERMINATING. Review URL: http://codereview.chromium.org/7129027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_list.h')
-rw-r--r--chrome/browser/ui/browser_list.h45
1 files changed, 31 insertions, 14 deletions
diff --git a/chrome/browser/ui/browser_list.h b/chrome/browser/ui/browser_list.h
index caa2e2f..1e01924 100644
--- a/chrome/browser/ui/browser_list.h
+++ b/chrome/browser/ui/browser_list.h
@@ -104,14 +104,37 @@ class BrowserList {
// 2. An update exe is present in the install folder.
static bool CanRestartForUpdate();
- // Called from Browser::Exit.
- static void Exit();
+ // Starts a user initiated exit process. Called from Browser::Exit.
+ // On platforms other than ChromeOS, this is equivalent to
+ // CloseAllBrowsersAndExit. On ChromeOS, this tells session manager
+ // that chrome is signing out, which lets session manager send
+ // SIGTERM to start actual exit process.
+ static void AttemptUserExit();
+
+ // Starts a user initiated restart process. On platforms other than
+ // chromeos, this sets a restart bit in the preference so that
+ // chrome will be restarted at the end of shutdown process. On
+ // ChromeOS, this simply exits the chrome, which lets sesssion
+ // manager re-launch the browser with restore last session flag.
+ static void AttemptRestart();
+
+ // Attempt to exit by closing all browsers. This is equivalent to
+ // CloseAllBrowsers() on platforms where the application exits
+ // when no more windows are remaining. On other platforms (the Mac),
+ // this will additionally exit the application if all browsers are
+ // successfully closed.
+ // Note that he exit process may be interrupted by download or
+ // unload handler, and the browser may or may not exit.
+ static void AttemptExit();
- // Closes all browsers and exits. This is equivalent to
- // CloseAllBrowsers(true) on platforms where the application exits when no
- // more windows are remaining. On other platforms (the Mac), this will
- // additionally exit the application.
- static void CloseAllBrowsersAndExit();
+#if defined(OS_CHROMEOS)
+ // This is equivalent to AttemptUserExit, except that it always set
+ // exit cleanly bit. ChroemOS checks if it can exit without user
+ // interactions, so it will always exit the browser. This is used to
+ // handle SIGTERM on chromeos which is a signal to force shutdown
+ // the chrome.
+ static void ExitCleanly();
+#endif
// Closes all browsers. If the session is ending the windows are closed
// directly. Otherwise the windows are closed by way of posting a WM_CLOSE
@@ -180,13 +203,7 @@ class BrowserList {
// Helper method to remove a browser instance from a list of browsers
static void RemoveBrowserFrom(Browser* browser, BrowserVector* browser_list);
static void MarkAsCleanShutdown();
-#if defined(OS_CHROMEOS)
- static bool NeedBeforeUnloadFired();
- static bool PendingDownloads();
- static void NotifyWindowManagerAboutSignout();
-
- static bool signout_;
-#endif
+ static void AttemptExitInternal();
static BrowserVector browsers_;
static BrowserVector last_active_browsers_;