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

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

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 12 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 | 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 loaded_locale = ResourceBundle::ReloadSharedInstance(locale); 111 loaded_locale = ResourceBundle::ReloadSharedInstance(locale);
112 } 112 }
113 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; 113 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
114 114
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
122 // shutdown from login screen. http://crosbug.com/20747
123 PrefService* prefs = g_browser_process->local_state(); 121 PrefService* prefs = g_browser_process->local_state();
124 prefs->SetString(prefs::kApplicationLocale, locale); 122 prefs->SetString(prefs::kApplicationLocale, locale);
125 prefs->ScheduleSavePersistentPrefs();
126 123
127 return true; 124 return true;
128 } 125 }
129 return false; 126 return false;
130 } 127 }
131 128
132 // static 129 // static
133 void LanguageSwitchMenu::LoadFontsForCurrentLocale() { 130 void LanguageSwitchMenu::LoadFontsForCurrentLocale() {
134 #if defined(TOOLKIT_USES_GTK) 131 #if defined(TOOLKIT_USES_GTK)
135 std::string gtkrc = l10n_util::GetStringUTF8(IDS_LOCALE_GTKRC); 132 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 198 // Here, we should enable keyboard layouts associated with the locale so
202 // that users can use those keyboard layouts on the login screen. 199 // that users can use those keyboard layouts on the login screen.
203 SwitchLanguageAndEnableKeyboardLayouts(locale); 200 SwitchLanguageAndEnableKeyboardLayouts(locale);
204 InitLanguageMenu(); 201 InitLanguageMenu();
205 202
206 // Update all view hierarchies that the locale has changed. 203 // Update all view hierarchies that the locale has changed.
207 views::Widget::NotifyLocaleChanged(); 204 views::Widget::NotifyLocaleChanged();
208 } 205 }
209 206
210 } // namespace chromeos 207 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/base_login_display_host.cc ('k') | chrome/browser/chromeos/login/login_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698