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 // Login screen should show up in owner's locale. | |
Nikita (slow)
2014/05/30 07:07:03
nit: insert empty line before comment.
Alexander Alekseev
2014/05/30 18:44:54
Done.
| |
153 std::string owner_locale = state->GetString(prefs::kOwnerLocale); | 151 std::string owner_locale = state->GetString(prefs::kOwnerLocale); |
154 if (!owner_locale.empty() && | 152 if (!owner_locale.empty() && |
155 state->GetString(prefs::kApplicationLocale) != owner_locale && | 153 state->GetString(prefs::kApplicationLocale) != owner_locale && |
156 !state->IsManagedPreference(prefs::kApplicationLocale)) { | 154 !state->IsManagedPreference(prefs::kApplicationLocale)) { |
157 state->SetString(prefs::kApplicationLocale, owner_locale); | 155 state->SetString(prefs::kApplicationLocale, owner_locale); |
158 TRACE_EVENT0("shutdown", "CommitPendingWrite"); | 156 TRACE_EVENT0("shutdown", "CommitPendingWrite"); |
159 state->CommitPendingWrite(); | 157 state->CommitPendingWrite(); |
160 } | 158 } |
161 } | 159 } |
162 g_send_stop_request_to_session_manager = true; | 160 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. | 396 // environment is still active. |
399 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 397 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
400 return !ash::Shell::HasInstance(); | 398 return !ash::Shell::HasInstance(); |
401 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 399 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
402 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 400 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
403 #endif | 401 #endif |
404 return true; | 402 return true; |
405 } | 403 } |
406 | 404 |
407 } // namespace chrome | 405 } // namespace chrome |
OLD | NEW |