| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "net/predictor_api.h" | 41 #include "net/predictor_api.h" |
| 42 | 42 |
| 43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 44 #include "chrome/browser/rlz/rlz.h" | 44 #include "chrome/browser/rlz/rlz.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
| 48 #include "chrome/browser/chromeos/boot_times_loader.h" | 48 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 49 #include "chrome/browser/chromeos/cros/cros_library.h" | 49 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 50 #include "chrome/browser/chromeos/cros/login_library.h" | 50 #include "chrome/browser/chromeos/cros/login_library.h" |
| 51 #include "chrome/browser/chromeos/wm_ipc.h" |
| 51 #endif | 52 #endif |
| 52 | 53 |
| 53 using base::Time; | 54 using base::Time; |
| 54 using base::TimeDelta; | 55 using base::TimeDelta; |
| 55 | 56 |
| 56 namespace browser_shutdown { | 57 namespace browser_shutdown { |
| 57 | 58 |
| 58 // 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). |
| 59 bool g_trying_to_quit = false; | 60 bool g_trying_to_quit = false; |
| 60 | 61 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 std::string shutdown_ms = | 245 std::string shutdown_ms = |
| 245 base::Int64ToString(shutdown_delta.InMilliseconds()); | 246 base::Int64ToString(shutdown_delta.InMilliseconds()); |
| 246 int len = static_cast<int>(shutdown_ms.length()) + 1; | 247 int len = static_cast<int>(shutdown_ms.length()) + 1; |
| 247 FilePath shutdown_ms_file = GetShutdownMsPath(); | 248 FilePath shutdown_ms_file = GetShutdownMsPath(); |
| 248 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); | 249 file_util::WriteFile(shutdown_ms_file, shutdown_ms.c_str(), len); |
| 249 } | 250 } |
| 250 | 251 |
| 251 UnregisterURLRequestChromeJob(); | 252 UnregisterURLRequestChromeJob(); |
| 252 | 253 |
| 253 #if defined(OS_CHROMEOS) | 254 #if defined(OS_CHROMEOS) |
| 255 chromeos::WmIpc::instance()->NotifyAboutSignout(); |
| 254 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 256 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { |
| 255 chromeos::CrosLibrary::Get()->GetLoginLibrary()->StopSession(""); | 257 chromeos::CrosLibrary::Get()->GetLoginLibrary()->StopSession(""); |
| 256 } | 258 } |
| 257 #endif | 259 #endif |
| 258 } | 260 } |
| 259 | 261 |
| 260 void ReadLastShutdownFile( | 262 void ReadLastShutdownFile( |
| 261 ShutdownType type, | 263 ShutdownType type, |
| 262 int num_procs, | 264 int num_procs, |
| 263 int num_procs_slow) { | 265 int num_procs_slow) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 332 |
| 331 bool ShuttingDownWithoutClosingBrowsers() { | 333 bool ShuttingDownWithoutClosingBrowsers() { |
| 332 #if defined(USE_X11) | 334 #if defined(USE_X11) |
| 333 if (GetShutdownType() == browser_shutdown::END_SESSION) | 335 if (GetShutdownType() == browser_shutdown::END_SESSION) |
| 334 return true; | 336 return true; |
| 335 #endif | 337 #endif |
| 336 return false; | 338 return false; |
| 337 } | 339 } |
| 338 | 340 |
| 339 } // namespace browser_shutdown | 341 } // namespace browser_shutdown |
| OLD | NEW |