| Index: chrome/browser/chromeos/login/language_switch_menu.cc
|
| diff --git a/chrome/browser/chromeos/login/language_switch_menu.cc b/chrome/browser/chromeos/login/language_switch_menu.cc
|
| old mode 100644
|
| new mode 100755
|
| index ae643581d2ee290d4e128dee44828ad7f0002498..d93e8fe85198b7ea876255391f8f829b4becfab5
|
| --- a/chrome/browser/chromeos/login/language_switch_menu.cc
|
| +++ b/chrome/browser/chromeos/login/language_switch_menu.cc
|
| @@ -88,19 +88,26 @@ void LanguageSwitchMenu::SwitchLanguage(const std::string& locale) {
|
| // Save new locale.
|
| DCHECK(g_browser_process);
|
| PrefService* prefs = g_browser_process->local_state();
|
| - prefs->SetString(prefs::kApplicationLocale, locale);
|
| - prefs->SavePersistentPrefs();
|
| -
|
| - // Switch the locale.
|
| - ResourceBundle::ReloadSharedInstance(UTF8ToWide(locale));
|
| -
|
| - // Enable the keyboard layouts that are necessary for the new locale.
|
| - chromeos::input_method::EnableInputMethods(
|
| - locale, chromeos::input_method::kKeyboardLayoutsOnly,
|
| - kHardwareKeyboardLayout);
|
| -
|
| - // The following line does not seem to affect locale anyhow. Maybe in future..
|
| - g_browser_process->SetApplicationLocale(locale);
|
| + // TODO(markusheintz): If the preference is managed and can not be changed by
|
| + // the user, changing the language should be disabled in the UI.
|
| + // TODO(markusheintz): Change the if condition to prefs->IsUserModifiable()
|
| + // once Mattias landed his pending patch.
|
| + if (!prefs->IsManagedPreference(prefs::kApplicationLocale)) {
|
| + prefs->SetString(prefs::kApplicationLocale, locale);
|
| + prefs->SavePersistentPrefs();
|
| +
|
| + // Switch the locale.
|
| + ResourceBundle::ReloadSharedInstance(UTF8ToWide(locale));
|
| +
|
| + // Enable the keyboard layouts that are necessary for the new locale.
|
| + chromeos::input_method::EnableInputMethods(
|
| + locale, chromeos::input_method::kKeyboardLayoutsOnly,
|
| + kHardwareKeyboardLayout);
|
| +
|
| + // The following line does not seem to affect locale anyhow. Maybe in
|
| + // future..
|
| + g_browser_process->SetApplicationLocale(locale);
|
| + }
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|