| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ | 5 #ifndef CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ |
| 6 #define CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ | 6 #define CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 | 9 |
| 10 class Browser; | 10 class Browser; |
| 11 | 11 |
| 12 namespace chrome { | 12 namespace chrome { |
| 13 | 13 |
| 14 // Starts a user initiated exit process. Called from Browser::Exit. | 14 // Starts a user initiated exit process. Called from Browser::Exit. |
| 15 // On platforms other than ChromeOS, this is equivalent to | 15 // On platforms other than ChromeOS, this is equivalent to |
| 16 // CloseAllBrowsers() On ChromeOS, this tells session manager | 16 // CloseAllBrowsers() On ChromeOS, this tells session manager |
| 17 // that chrome is signing out, which lets session manager send | 17 // that chrome is signing out, which lets session manager send |
| 18 // SIGTERM to start actual exit process. | 18 // SIGTERM to start actual exit process. |
| 19 void AttemptUserExit(); | 19 void AttemptUserExit(); |
| 20 | 20 |
| 21 // Starts to collect shutdown traces. On ChromeOS this will start immediately | |
| 22 // on AttemptUserExit() and all other systems will start once all tabs are | |
| 23 // closed. | |
| 24 void StartShutdownTracing(); | |
| 25 | |
| 26 // Starts a user initiated restart process. On platforms other than | 21 // Starts a user initiated restart process. On platforms other than |
| 27 // chromeos, this sets a restart bit in the preference so that | 22 // chromeos, this sets a restart bit in the preference so that |
| 28 // chrome will be restarted at the end of shutdown process. On | 23 // chrome will be restarted at the end of shutdown process. On |
| 29 // ChromeOS, this simply exits the chrome, which lets sesssion | 24 // ChromeOS, this simply exits the chrome, which lets sesssion |
| 30 // manager re-launch the browser with restore last session flag. | 25 // manager re-launch the browser with restore last session flag. |
| 31 void AttemptRestart(); | 26 void AttemptRestart(); |
| 32 | 27 |
| 33 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 34 enum AshExecutionStatus { | 29 enum AshExecutionStatus { |
| 35 ASH_KEEP_RUNNING, | 30 ASH_KEEP_RUNNING, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // For ChromeOS, also request session manager to end the session. | 100 // For ChromeOS, also request session manager to end the session. |
| 106 void NotifyAndTerminate(bool fast_path); | 101 void NotifyAndTerminate(bool fast_path); |
| 107 | 102 |
| 108 // Called once the application is exiting. | 103 // Called once the application is exiting. |
| 109 void OnAppExiting(); | 104 void OnAppExiting(); |
| 110 | 105 |
| 111 // Called once the application is exiting to do any platform specific | 106 // Called once the application is exiting to do any platform specific |
| 112 // processing required. | 107 // processing required. |
| 113 void HandleAppExitingForPlatform(); | 108 void HandleAppExitingForPlatform(); |
| 114 | 109 |
| 115 // Returns true if we can start the shutdown sequence for the browser, i.e. the | |
| 116 // last browser window is being closed. | |
| 117 bool ShouldStartShutdown(Browser* browser); | |
| 118 | |
| 119 // Disable browser shutdown for unit tests. | 110 // Disable browser shutdown for unit tests. |
| 120 void DisableShutdownForTesting(bool disable_shutdown_for_testing); | 111 void DisableShutdownForTesting(bool disable_shutdown_for_testing); |
| 121 | 112 |
| 122 } // namespace chrome | 113 } // namespace chrome |
| 123 | 114 |
| 124 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ | 115 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ |
| OLD | NEW |