| 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 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Closes all browsers and if successful, quits. | 50 // Closes all browsers and if successful, quits. |
| 51 void CloseAllBrowsersAndQuit(); | 51 void CloseAllBrowsersAndQuit(); |
| 52 | 52 |
| 53 // Closes all browsers. If the session is ending the windows are closed | 53 // Closes all browsers. If the session is ending the windows are closed |
| 54 // directly. Otherwise the windows are closed by way of posting a WM_CLOSE | 54 // directly. Otherwise the windows are closed by way of posting a WM_CLOSE |
| 55 // message. This will quit the application if there is nothing other than | 55 // message. This will quit the application if there is nothing other than |
| 56 // browser windows keeping it alive or the application is quitting. | 56 // browser windows keeping it alive or the application is quitting. |
| 57 void CloseAllBrowsers(); | 57 void CloseAllBrowsers(); |
| 58 | 58 |
| 59 // If there are no browsers open and we aren't already shutting down, | 59 // If there are no browsers open and we aren't already shutting down, |
| 60 // initiate a shutdown. Also skips shutdown if this is a unit test. | 60 // initiate a shutdown. |
| 61 // (MessageLoop::current() == null or explicitly disabled). | 61 void ShutdownIfNeeded(); |
| 62 void CloseAllBrowsersIfNeeded(); | |
| 63 | 62 |
| 64 // Begins shutdown of the application when the desktop session is ending. | 63 // Begins shutdown of the application when the desktop session is ending. |
| 65 void SessionEnding(); | 64 void SessionEnding(); |
| 66 | 65 |
| 67 #endif // !defined(OS_ANDROID) | 66 #endif // !defined(OS_ANDROID) |
| 68 | 67 |
| 69 // Emits APP_TERMINATING notification. It is guaranteed that the | 68 // Emits APP_TERMINATING notification. It is guaranteed that the |
| 70 // notification is sent only once. | 69 // notification is sent only once. |
| 71 void NotifyAppTerminating(); | 70 void NotifyAppTerminating(); |
| 72 | 71 |
| 73 // Send out notifications. | 72 // Send out notifications. |
| 74 // For ChromeOS, also request session manager to end the session. | 73 // For ChromeOS, also request session manager to end the session. |
| 75 void NotifyAndTerminate(bool fast_path); | 74 void NotifyAndTerminate(bool fast_path); |
| 76 | 75 |
| 77 #if !defined(OS_ANDROID) | 76 #if !defined(OS_ANDROID) |
| 78 // Called once the application is exiting. | 77 // Called once the application is exiting. |
| 79 void OnAppExiting(); | 78 void OnAppExiting(); |
| 80 | 79 |
| 81 // Called once the application is exiting to do any platform specific | 80 // Called once the application is exiting to do any platform specific |
| 82 // processing required. | 81 // processing required. |
| 83 void HandleAppExitingForPlatform(); | 82 void HandleAppExitingForPlatform(); |
| 84 | |
| 85 // Disable browser shutdown for unit tests. | |
| 86 void DisableShutdownForTesting(bool disable_shutdown_for_testing); | |
| 87 #endif // !defined(OS_ANDROID) | 83 #endif // !defined(OS_ANDROID) |
| 88 | 84 |
| 89 } // namespace chrome | 85 } // namespace chrome |
| 90 | 86 |
| 91 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ | 87 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ |
| OLD | NEW |