| 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/lifetime/application_lifetime.h" | 5 #include "chrome/browser/lifetime/application_lifetime.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 #endif | 136 #endif |
| 137 scoped_refptr<BrowserCloseManager> browser_close_manager = | 137 scoped_refptr<BrowserCloseManager> browser_close_manager = |
| 138 new BrowserCloseManager; | 138 new BrowserCloseManager; |
| 139 browser_close_manager->StartClosingBrowsers(); | 139 browser_close_manager->StartClosingBrowsers(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void AttemptUserExit() { | 142 void AttemptUserExit() { |
| 143 #if defined(OS_CHROMEOS) | 143 #if defined(OS_CHROMEOS) |
| 144 StartShutdownTracing(); | 144 StartShutdownTracing(); |
| 145 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); | 145 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); |
| 146 // Write /tmp/uptime-logout-started as well. | |
| 147 const char kLogoutStarted[] = "logout-started"; | |
| 148 chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted); | |
| 149 | 146 |
| 150 // Login screen should show up in owner's locale. | |
| 151 PrefService* state = g_browser_process->local_state(); | 147 PrefService* state = g_browser_process->local_state(); |
| 152 if (state) { | 148 if (state) { |
| 149 chromeos::BootTimesLoader::Get()->OnLogoutStarted(state); |
| 150 |
| 151 // Login screen should show up in owner's locale. |
| 153 std::string owner_locale = state->GetString(prefs::kOwnerLocale); | 152 std::string owner_locale = state->GetString(prefs::kOwnerLocale); |
| 154 if (!owner_locale.empty() && | 153 if (!owner_locale.empty() && |
| 155 state->GetString(prefs::kApplicationLocale) != owner_locale && | 154 state->GetString(prefs::kApplicationLocale) != owner_locale && |
| 156 !state->IsManagedPreference(prefs::kApplicationLocale)) { | 155 !state->IsManagedPreference(prefs::kApplicationLocale)) { |
| 157 state->SetString(prefs::kApplicationLocale, owner_locale); | 156 state->SetString(prefs::kApplicationLocale, owner_locale); |
| 158 TRACE_EVENT0("shutdown", "CommitPendingWrite"); | 157 TRACE_EVENT0("shutdown", "CommitPendingWrite"); |
| 159 state->CommitPendingWrite(); | 158 state->CommitPendingWrite(); |
| 160 } | 159 } |
| 161 } | 160 } |
| 162 g_send_stop_request_to_session_manager = true; | 161 g_send_stop_request_to_session_manager = true; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // environment is still active. | 397 // environment is still active. |
| 399 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 398 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
| 400 return !ash::Shell::HasInstance(); | 399 return !ash::Shell::HasInstance(); |
| 401 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 400 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 402 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 401 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
| 403 #endif | 402 #endif |
| 404 return true; | 403 return true; |
| 405 } | 404 } |
| 406 | 405 |
| 407 } // namespace chrome | 406 } // namespace chrome |
| OLD | NEW |