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