| 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/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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 LoadFontsForCurrentLocale(); | 117 LoadFontsForCurrentLocale(); |
| 118 | 118 |
| 119 // The following line does not seem to affect locale anyhow. Maybe in | 119 // The following line does not seem to affect locale anyhow. Maybe in |
| 120 // future.. | 120 // future.. |
| 121 g_browser_process->SetApplicationLocale(locale); | 121 g_browser_process->SetApplicationLocale(locale); |
| 122 | 122 |
| 123 // Force preferences save, otherwise they won't be saved on | 123 // Force preferences save, otherwise they won't be saved on |
| 124 // shutdown from login screen. http://crosbug.com/20747 | 124 // shutdown from login screen. http://crosbug.com/20747 |
| 125 PrefService* prefs = g_browser_process->local_state(); | 125 PrefService* prefs = g_browser_process->local_state(); |
| 126 prefs->SetString(prefs::kApplicationLocale, locale); | 126 prefs->SetString(prefs::kApplicationLocale, locale); |
| 127 prefs->SavePersistentPrefs(); | 127 prefs->CommitPendingWrite(); |
| 128 | 128 |
| 129 return true; | 129 return true; |
| 130 } | 130 } |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 | 133 |
| 134 // static | 134 // static |
| 135 void LanguageSwitchMenu::LoadFontsForCurrentLocale() { | 135 void LanguageSwitchMenu::LoadFontsForCurrentLocale() { |
| 136 std::string gtkrc = l10n_util::GetStringUTF8(IDS_LOCALE_GTKRC); | 136 std::string gtkrc = l10n_util::GetStringUTF8(IDS_LOCALE_GTKRC); |
| 137 | 137 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Here, we should enable keyboard layouts associated with the locale so | 198 // Here, we should enable keyboard layouts associated with the locale so |
| 199 // that users can use those keyboard layouts on the login screen. | 199 // that users can use those keyboard layouts on the login screen. |
| 200 SwitchLanguageAndEnableKeyboardLayouts(locale); | 200 SwitchLanguageAndEnableKeyboardLayouts(locale); |
| 201 InitLanguageMenu(); | 201 InitLanguageMenu(); |
| 202 | 202 |
| 203 // Update all view hierarchies that the locale has changed. | 203 // Update all view hierarchies that the locale has changed. |
| 204 views::Widget::NotifyLocaleChanged(); | 204 views::Widget::NotifyLocaleChanged(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace chromeos | 207 } // namespace chromeos |
| OLD | NEW |