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 class Browser; | 8 class Browser; |
9 | 9 |
10 namespace chrome { | 10 namespace chrome { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
48 // This is equivalent to AttemptUserExit, except that it always set | 48 // This is equivalent to AttemptUserExit, except that it always set |
49 // exit cleanly bit. ChromeOS checks if it can exit without user | 49 // exit cleanly bit. ChromeOS checks if it can exit without user |
50 // interactions, so it will always exit the browser. This is used to | 50 // interactions, so it will always exit the browser. This is used to |
51 // handle SIGTERM on chromeos which is a signal to force shutdown | 51 // handle SIGTERM on chromeos which is a signal to force shutdown |
52 // the chrome. | 52 // the chrome. |
53 void ExitCleanly(); | 53 void ExitCleanly(); |
54 #endif | 54 #endif |
55 | 55 |
| 56 // Closes all browsers and if successful, quits. |
| 57 void CloseAllBrowsersAndQuit(); |
| 58 |
56 // Closes all browsers. If the session is ending the windows are closed | 59 // Closes all browsers. If the session is ending the windows are closed |
57 // directly. Otherwise the windows are closed by way of posting a WM_CLOSE | 60 // directly. Otherwise the windows are closed by way of posting a WM_CLOSE |
58 // message. | 61 // message. This will quit the application if there is nothing other than |
| 62 // browser windows keeping it alive or the application is quitting. |
59 void CloseAllBrowsers(); | 63 void CloseAllBrowsers(); |
60 | 64 |
61 // Begins shutdown of the application when the desktop session is ending. | 65 // Begins shutdown of the application when the desktop session is ending. |
62 void SessionEnding(); | 66 void SessionEnding(); |
63 | 67 |
64 // Tells the BrowserList to keep the application alive after the last Browser | 68 // Tells the BrowserList to keep the application alive after the last Browser |
65 // closes. This is implemented as a count, so callers should pair their calls | 69 // closes. This is implemented as a count, so callers should pair their calls |
66 // to StartKeepAlive() with matching calls to EndKeepAlive() when they no | 70 // to StartKeepAlive() with matching calls to EndKeepAlive() when they no |
67 // longer need to keep the application running. | 71 // longer need to keep the application running. |
68 void StartKeepAlive(); | 72 void StartKeepAlive(); |
(...skipping 21 matching lines...) Expand all Loading... |
90 // processing required. | 94 // processing required. |
91 void HandleAppExitingForPlatform(); | 95 void HandleAppExitingForPlatform(); |
92 | 96 |
93 // Returns true if we can start the shutdown sequence for the browser, i.e. the | 97 // Returns true if we can start the shutdown sequence for the browser, i.e. the |
94 // last browser window is being closed. | 98 // last browser window is being closed. |
95 bool ShouldStartShutdown(Browser* browser); | 99 bool ShouldStartShutdown(Browser* browser); |
96 | 100 |
97 } // namespace chrome | 101 } // namespace chrome |
98 | 102 |
99 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ | 103 #endif // CHROME_BROWSER_LIFETIME_APPLICATION_LIFETIME_H_ |
OLD | NEW |