OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #endif | 53 #endif |
54 | 54 |
55 using base::Time; | 55 using base::Time; |
56 using base::TimeDelta; | 56 using base::TimeDelta; |
57 | 57 |
58 namespace browser_shutdown { | 58 namespace browser_shutdown { |
59 | 59 |
60 // Whether the browser is trying to quit (e.g., Quit chosen from menu). | 60 // Whether the browser is trying to quit (e.g., Quit chosen from menu). |
61 bool g_trying_to_quit = false; | 61 bool g_trying_to_quit = false; |
62 | 62 |
| 63 // Whether the browser should quit without closing browsers. |
| 64 bool g_shutting_down_without_closing_browsers = false; |
| 65 |
63 Time shutdown_started_; | 66 Time shutdown_started_; |
64 ShutdownType shutdown_type_ = NOT_VALID; | 67 ShutdownType shutdown_type_ = NOT_VALID; |
65 int shutdown_num_processes_; | 68 int shutdown_num_processes_; |
66 int shutdown_num_processes_slow_; | 69 int shutdown_num_processes_slow_; |
67 | 70 |
68 bool delete_resources_on_shutdown = true; | 71 bool delete_resources_on_shutdown = true; |
69 | 72 |
70 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; | 73 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; |
71 | 74 |
72 void RegisterPrefs(PrefService* local_state) { | 75 void RegisterPrefs(PrefService* local_state) { |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 306 |
304 void SetTryingToQuit(bool quitting) { | 307 void SetTryingToQuit(bool quitting) { |
305 g_trying_to_quit = quitting; | 308 g_trying_to_quit = quitting; |
306 } | 309 } |
307 | 310 |
308 bool IsTryingToQuit() { | 311 bool IsTryingToQuit() { |
309 return g_trying_to_quit; | 312 return g_trying_to_quit; |
310 } | 313 } |
311 | 314 |
312 bool ShuttingDownWithoutClosingBrowsers() { | 315 bool ShuttingDownWithoutClosingBrowsers() { |
313 #if defined(USE_X11) | 316 return g_shutting_down_without_closing_browsers; |
314 if (GetShutdownType() == browser_shutdown::END_SESSION) | 317 } |
315 return true; | 318 |
316 #endif | 319 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
317 return false; | 320 g_shutting_down_without_closing_browsers = without_close; |
318 } | 321 } |
319 | 322 |
320 } // namespace browser_shutdown | 323 } // namespace browser_shutdown |
OLD | NEW |