Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 303233004: Write "logout-started" event on next boot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add exception for ScopedAllowIO. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698