| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // closes. This is implemented as a count, so callers should pair their calls | 63 // closes. This is implemented as a count, so callers should pair their calls |
| 64 // to IncrementKeepAliveCount() with matching calls to DecrementKeepAliveCount() | 64 // to IncrementKeepAliveCount() with matching calls to DecrementKeepAliveCount() |
| 65 // when they no | 65 // when they no |
| 66 // longer need to keep the application running. | 66 // longer need to keep the application running. |
| 67 void IncrementKeepAliveCount(); | 67 void IncrementKeepAliveCount(); |
| 68 | 68 |
| 69 // Stops keeping the application alive after the last Browser is closed. | 69 // Stops keeping the application alive after the last Browser is closed. |
| 70 // Should match a previous call to IncrementKeepAliveCount(). | 70 // Should match a previous call to IncrementKeepAliveCount(). |
| 71 void DecrementKeepAliveCount(); | 71 void DecrementKeepAliveCount(); |
| 72 | 72 |
| 73 // Returns the current keep alive count. |
| 74 int GetKeepAliveCountForTesting(); |
| 75 |
| 73 // Returns true if application will continue running after the last Browser | 76 // Returns true if application will continue running after the last Browser |
| 74 // closes. | 77 // closes. |
| 75 bool WillKeepAlive(); | 78 bool WillKeepAlive(); |
| 76 #endif // !defined(OS_ANDROID) | 79 #endif // !defined(OS_ANDROID) |
| 77 | 80 |
| 78 // Emits APP_TERMINATING notification. It is guaranteed that the | 81 // Emits APP_TERMINATING notification. It is guaranteed that the |
| 79 // notification is sent only once. | 82 // notification is sent only once. |
| 80 void NotifyAppTerminating(); | 83 void NotifyAppTerminating(); |
| 81 | 84 |
| 82 // Send out notifications. | 85 // Send out notifications. |
| 83 // For ChromeOS, also request session manager to end the session. | 86 // For ChromeOS, also request session manager to end the session. |
| 84 void NotifyAndTerminate(bool fast_path); | 87 void NotifyAndTerminate(bool fast_path); |
| 85 | 88 |
| 86 #if !defined(OS_ANDROID) | 89 #if !defined(OS_ANDROID) |
| 87 // Called once the application is exiting. | 90 // Called once the application is exiting. |
| 88 void OnAppExiting(); | 91 void OnAppExiting(); |
| 89 | 92 |
| 90 // Called once the application is exiting to do any platform specific | 93 // Called once the application is exiting to do any platform specific |
| 91 // processing required. | 94 // processing required. |
| 92 void HandleAppExitingForPlatform(); | 95 void HandleAppExitingForPlatform(); |
| 93 | 96 |
| 94 // Disable browser shutdown for unit tests. | 97 // Disable browser shutdown for unit tests. |
| 95 void DisableShutdownForTesting(bool disable_shutdown_for_testing); | 98 void DisableShutdownForTesting(bool disable_shutdown_for_testing); |
| 96 #endif // !defined(OS_ANDROID) | 99 #endif // !defined(OS_ANDROID) |
| 97 | 100 |
| 98 } // namespace chrome | 101 } // namespace chrome |
| 99 | 102 |
| 100 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ | 103 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ |
| OLD | NEW |