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

Side by Side Diff: chrome/browser/chromeos/login/language_switch_menu.cc

Issue 8341105: [cros] Use ScheduleSavePersistentPrefs instead of SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove change from OOBE boot. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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/chromeos/login/language_switch_menu.h" 5 #include "chrome/browser/chromeos/login/language_switch_menu.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 LoadFontsForCurrentLocale(); 115 LoadFontsForCurrentLocale();
116 116
117 // The following line does not seem to affect locale anyhow. Maybe in 117 // The following line does not seem to affect locale anyhow. Maybe in
118 // future.. 118 // future..
119 g_browser_process->SetApplicationLocale(locale); 119 g_browser_process->SetApplicationLocale(locale);
120 120
121 // Force preferences save, otherwise they won't be saved on 121 // Force preferences save, otherwise they won't be saved on
122 // shutdown from login screen. http://crosbug.com/20747 122 // shutdown from login screen. http://crosbug.com/20747
123 PrefService* prefs = g_browser_process->local_state(); 123 PrefService* prefs = g_browser_process->local_state();
124 prefs->SetString(prefs::kApplicationLocale, locale); 124 prefs->SetString(prefs::kApplicationLocale, locale);
125 prefs->SavePersistentPrefs(); 125 prefs->ScheduleSavePersistentPrefs();
126 126
127 return true; 127 return true;
128 } 128 }
129 return false; 129 return false;
130 } 130 }
131 131
132 // static 132 // static
133 void LanguageSwitchMenu::LoadFontsForCurrentLocale() { 133 void LanguageSwitchMenu::LoadFontsForCurrentLocale() {
134 #if defined(TOOLKIT_USES_GTK) 134 #if defined(TOOLKIT_USES_GTK)
135 std::string gtkrc = l10n_util::GetStringUTF8(IDS_LOCALE_GTKRC); 135 std::string gtkrc = l10n_util::GetStringUTF8(IDS_LOCALE_GTKRC);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // Here, we should enable keyboard layouts associated with the locale so 201 // Here, we should enable keyboard layouts associated with the locale so
202 // that users can use those keyboard layouts on the login screen. 202 // that users can use those keyboard layouts on the login screen.
203 SwitchLanguageAndEnableKeyboardLayouts(locale); 203 SwitchLanguageAndEnableKeyboardLayouts(locale);
204 InitLanguageMenu(); 204 InitLanguageMenu();
205 205
206 // Update all view hierarchies that the locale has changed. 206 // Update all view hierarchies that the locale has changed.
207 views::Widget::NotifyLocaleChanged(); 207 views::Widget::NotifyLocaleChanged();
208 } 208 }
209 209
210 } // namespace chromeos 210 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/accessibility_util.cc ('k') | chrome/browser/chromeos/login/user_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698