OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
36 #include "chrome/browser/rlz/rlz.h" | 36 #include "chrome/browser/rlz/rlz.h" |
37 #endif | 37 #endif |
38 | 38 |
39 using base::Time; | 39 using base::Time; |
40 using base::TimeDelta; | 40 using base::TimeDelta; |
41 | 41 |
42 namespace browser_shutdown { | 42 namespace browser_shutdown { |
43 | 43 |
| 44 #if defined(OS_MACOSX) |
| 45 // Whether the browser is trying to quit (e.g., Quit chosen from menu). |
| 46 bool g_trying_to_quit = false; |
| 47 #endif // OS_MACOSX |
| 48 |
44 Time shutdown_started_; | 49 Time shutdown_started_; |
45 ShutdownType shutdown_type_ = NOT_VALID; | 50 ShutdownType shutdown_type_ = NOT_VALID; |
46 int shutdown_num_processes_; | 51 int shutdown_num_processes_; |
47 int shutdown_num_processes_slow_; | 52 int shutdown_num_processes_slow_; |
48 | 53 |
49 bool delete_resources_on_shutdown = true; | 54 bool delete_resources_on_shutdown = true; |
50 | 55 |
51 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; | 56 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; |
52 | 57 |
53 void RegisterPrefs(PrefService* local_state) { | 58 void RegisterPrefs(PrefService* local_state) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 prefs->SetInteger(prefs::kShutdownNumProcesses, 0); | 224 prefs->SetInteger(prefs::kShutdownNumProcesses, 0); |
220 prefs->SetInteger(prefs::kShutdownNumProcessesSlow, 0); | 225 prefs->SetInteger(prefs::kShutdownNumProcessesSlow, 0); |
221 | 226 |
222 // Read and delete the file on the file thread. | 227 // Read and delete the file on the file thread. |
223 ChromeThread::PostTask( | 228 ChromeThread::PostTask( |
224 ChromeThread::FILE, FROM_HERE, | 229 ChromeThread::FILE, FROM_HERE, |
225 NewRunnableFunction( | 230 NewRunnableFunction( |
226 &ReadLastShutdownFile, type, num_procs, num_procs_slow)); | 231 &ReadLastShutdownFile, type, num_procs, num_procs_slow)); |
227 } | 232 } |
228 | 233 |
| 234 #if defined(OS_MACOSX) |
| 235 void SetTryingToQuit(bool quitting) { |
| 236 g_trying_to_quit = quitting; |
| 237 } |
| 238 |
| 239 bool IsTryingToQuit() { |
| 240 return g_trying_to_quit; |
| 241 } |
| 242 #endif |
| 243 |
229 } // namespace browser_shutdown | 244 } // namespace browser_shutdown |
OLD | NEW |