| 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 #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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 #if defined(ENABLE_RLZ) | 41 #if defined(ENABLE_RLZ) |
| 42 #include "chrome/browser/rlz/rlz.h" | 42 #include "chrome/browser/rlz/rlz.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 46 #include "chrome/browser/chromeos/boot_times_loader.h" | 46 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 #if defined(ENABLE_FULL_PRINTING) | 49 #if defined(ENABLE_PRINT_PREVIEW) |
| 50 #include "chrome/browser/service_process/service_process_control.h" | 50 #include "chrome/browser/service_process/service_process_control.h" |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 using base::Time; | 53 using base::Time; |
| 54 using base::TimeDelta; | 54 using base::TimeDelta; |
| 55 using content::BrowserThread; | 55 using content::BrowserThread; |
| 56 | 56 |
| 57 namespace browser_shutdown { | 57 namespace browser_shutdown { |
| 58 namespace { | 58 namespace { |
| 59 | 59 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 base::FilePath shutdown_ms_file; | 136 base::FilePath shutdown_ms_file; |
| 137 PathService::Get(chrome::DIR_USER_DATA, &shutdown_ms_file); | 137 PathService::Get(chrome::DIR_USER_DATA, &shutdown_ms_file); |
| 138 return shutdown_ms_file.AppendASCII(kShutdownMsFile); | 138 return shutdown_ms_file.AppendASCII(kShutdownMsFile); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool ShutdownPreThreadsStop() { | 141 bool ShutdownPreThreadsStop() { |
| 142 #if defined(OS_CHROMEOS) | 142 #if defined(OS_CHROMEOS) |
| 143 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker( | 143 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker( |
| 144 "BrowserShutdownStarted", false); | 144 "BrowserShutdownStarted", false); |
| 145 #endif | 145 #endif |
| 146 #if defined(ENABLE_FULL_PRINTING) | 146 #if defined(ENABLE_PRINT_PREVIEW) |
| 147 // Shutdown the IPC channel to the service processes. | 147 // Shutdown the IPC channel to the service processes. |
| 148 ServiceProcessControl::GetInstance()->Disconnect(); | 148 ServiceProcessControl::GetInstance()->Disconnect(); |
| 149 #endif // ENABLE_FULL_PRINTING | 149 #endif // ENABLE_PRINT_PREVIEW |
| 150 | 150 |
| 151 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough | 151 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough |
| 152 // time to get here. If you have something that *must* happen on end session, | 152 // time to get here. If you have something that *must* happen on end session, |
| 153 // consider putting it in BrowserProcessImpl::EndSession. | 153 // consider putting it in BrowserProcessImpl::EndSession. |
| 154 PrefService* prefs = g_browser_process->local_state(); | 154 PrefService* prefs = g_browser_process->local_state(); |
| 155 | 155 |
| 156 metrics::MetricsService* metrics = g_browser_process->metrics_service(); | 156 metrics::MetricsService* metrics = g_browser_process->metrics_service(); |
| 157 if (metrics) | 157 if (metrics) |
| 158 metrics->RecordCompletedSessionEnd(); | 158 metrics->RecordCompletedSessionEnd(); |
| 159 | 159 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 331 |
| 332 void SetTryingToQuit(bool quitting) { | 332 void SetTryingToQuit(bool quitting) { |
| 333 g_trying_to_quit = quitting; | 333 g_trying_to_quit = quitting; |
| 334 } | 334 } |
| 335 | 335 |
| 336 bool IsTryingToQuit() { | 336 bool IsTryingToQuit() { |
| 337 return g_trying_to_quit; | 337 return g_trying_to_quit; |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace browser_shutdown | 340 } // namespace browser_shutdown |
| OLD | NEW |