| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser_list.h" | 5 #include "chrome/browser/ui/browser_list.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted); | 448 chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted); |
| 449 | 449 |
| 450 // Login screen should show up in owner's locale. | 450 // Login screen should show up in owner's locale. |
| 451 PrefService* state = g_browser_process->local_state(); | 451 PrefService* state = g_browser_process->local_state(); |
| 452 if (state) { | 452 if (state) { |
| 453 std::string owner_locale = state->GetString(prefs::kOwnerLocale); | 453 std::string owner_locale = state->GetString(prefs::kOwnerLocale); |
| 454 if (!owner_locale.empty() && | 454 if (!owner_locale.empty() && |
| 455 state->GetString(prefs::kApplicationLocale) != owner_locale && | 455 state->GetString(prefs::kApplicationLocale) != owner_locale && |
| 456 !state->IsManagedPreference(prefs::kApplicationLocale)) { | 456 !state->IsManagedPreference(prefs::kApplicationLocale)) { |
| 457 state->SetString(prefs::kApplicationLocale, owner_locale); | 457 state->SetString(prefs::kApplicationLocale, owner_locale); |
| 458 state->SavePersistentPrefs(); | 458 state->CommitPendingWrite(); |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 if (FastShutdown()) | 461 if (FastShutdown()) |
| 462 return; | 462 return; |
| 463 #else | 463 #else |
| 464 // Reset the restart bit that might have been set in cancelled restart | 464 // Reset the restart bit that might have been set in cancelled restart |
| 465 // request. | 465 // request. |
| 466 PrefService* pref_service = g_browser_process->local_state(); | 466 PrefService* pref_service = g_browser_process->local_state(); |
| 467 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); | 467 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); |
| 468 #endif | 468 #endif |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 771 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
| 772 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 772 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
| 773 cur_ = *bg_printing_iterator_; | 773 cur_ = *bg_printing_iterator_; |
| 774 CHECK(cur_); | 774 CHECK(cur_); |
| 775 ++bg_printing_iterator_; | 775 ++bg_printing_iterator_; |
| 776 return; | 776 return; |
| 777 } | 777 } |
| 778 // Reached the end - no more TabContents. | 778 // Reached the end - no more TabContents. |
| 779 cur_ = NULL; | 779 cur_ = NULL; |
| 780 } | 780 } |
| OLD | NEW |