Chromium Code Reviews| Index: chrome/browser/chromeos/dom_ui/language_options_handler.cc |
| diff --git a/chrome/browser/chromeos/dom_ui/language_options_handler.cc b/chrome/browser/chromeos/dom_ui/language_options_handler.cc |
| index 05570bca74e3a4a8f43e4436c88e2e587901e552..b3620becda4f8c34e5422ec71c3ad0dc1dcc13b1 100644 |
| --- a/chrome/browser/chromeos/dom_ui/language_options_handler.cc |
| +++ b/chrome/browser/chromeos/dom_ui/language_options_handler.cc |
| @@ -10,6 +10,7 @@ |
| #include <utility> |
| #include "app/l10n_util.h" |
| +#include "base/basictypes.h" |
| #include "base/utf_string_conversions.h" |
| #include "base/values.h" |
| #include "chrome/app/chrome_command_ids.h" |
| @@ -20,6 +21,7 @@ |
| #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| #include "chrome/browser/metrics/user_metrics.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| +#include "chrome/browser/profile.h" |
| #include "chrome/browser/tab_contents/tab_contents.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/spellcheck_common.h" |
| @@ -57,7 +59,8 @@ void LanguageOptionsHandler::GetLocalizedValues( |
| localized_strings->SetString("remove_button", |
| l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_REMOVE_BUTTON)); |
| localized_strings->SetString("sign_out_button", |
| - l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_SIGN_OUT_BUTTON)); |
| + l10n_util::GetStringUTF16( |
| + IDS_OPTIONS_SETTINGS_LANGUAGES_SIGN_OUT_BUTTON)); |
| localized_strings->SetString("add_language_instructions", |
| l10n_util::GetStringUTF16( |
| IDS_OPTIONS_SETTINGS_LANGUAGES_ADD_LANGUAGE_INSTRUCTIONS)); |
| @@ -287,9 +290,14 @@ void LanguageOptionsHandler::UiLanguageChangeCallback( |
| "LanguageOptions_UiLanguageChange_%s", language_code.c_str()); |
| UserMetrics::RecordComputedAction(action); |
| - PrefService* prefs = g_browser_process->local_state(); |
| - prefs->SetString(prefs::kApplicationLocale, language_code); |
| - prefs->SavePersistentPrefs(); |
| + PrefService* prefs[] = { |
|
glotov
2010/11/11 18:16:23
Please comment why there is 2 PrefServices.
Denis Lagno
2010/11/12 11:51:35
Done.
|
| + g_browser_process->local_state(), |
| + dom_ui_->GetProfile()->GetPrefs() |
| + }; |
| + for (size_t i = 0; i < arraysize(prefs); ++i) { |
| + prefs[i]->SetString(prefs::kApplicationLocale, language_code); |
| + prefs[i]->SavePersistentPrefs(); |
| + } |
| dom_ui_->CallJavascriptFunction( |
| L"options.LanguageOptions.uiLanguageSaved"); |
| } |