| Index: chrome/browser/chromeos/login/language_switch_model.cc
|
| ===================================================================
|
| --- chrome/browser/chromeos/login/language_switch_model.cc (revision 49913)
|
| +++ chrome/browser/chromeos/login/language_switch_model.cc (working copy)
|
| @@ -81,6 +81,21 @@
|
| gtk_widget_set_size_request(menu_->GetNativeMenu(), width, -1);
|
| }
|
|
|
| +// static
|
| +void LanguageSwitchModel::SwitchLanguage(const std::string& locale) {
|
| + // Save new locale.
|
| + DCHECK(g_browser_process);
|
| + PrefService* prefs = g_browser_process->local_state();
|
| + prefs->SetString(prefs::kApplicationLocale, UTF8ToWide(locale));
|
| + prefs->SavePersistentPrefs();
|
| +
|
| + // Switch the locale.
|
| + ResourceBundle::ReloadSharedInstance(UTF8ToWide(locale));
|
| +
|
| + // The following line does not seem to affect locale anyhow. Maybe in future..
|
| + g_browser_process->SetApplicationLocale(locale);
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // views::ViewMenuDelegate implementation.
|
|
|
| @@ -116,22 +131,4 @@
|
| views::Widget::NotifyLocaleChanged();
|
| }
|
|
|
| -////////////////////////////////////////////////////////////////////////////////
|
| -// Private implementation.
|
| -
|
| -// static
|
| -void LanguageSwitchModel::SwitchLanguage(const std::string& locale) {
|
| - // Save new locale.
|
| - DCHECK(g_browser_process);
|
| - PrefService* prefs = g_browser_process->local_state();
|
| - prefs->SetString(prefs::kApplicationLocale, UTF8ToWide(locale));
|
| - prefs->SavePersistentPrefs();
|
| -
|
| - // Switch the locale.
|
| - ResourceBundle::ReloadSharedInstance(UTF8ToWide(locale));
|
| -
|
| - // The following line does not seem to affect locale anyhow. Maybe in future..
|
| - g_browser_process->SetApplicationLocale(locale);
|
| -}
|
| -
|
| } // namespace chromeos
|
|
|