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

Unified Diff: chrome/browser/chromeos/dom_ui/language_options_handler.cc

Issue 3579011: Chrome OS: make language per user. (Closed)
Patch Set: spellfix Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/language_switch_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..93135a7b390991e3b8735698e0092f1c4c525fae 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,17 @@ 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();
+ // We maintain kApplicationLocale property in both a global storage
+ // and user's profile. Global property determines locale of login screen,
+ // while user's profile determines his personal locale preference.
+ PrefService* prefs[] = {
+ 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");
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/language_switch_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698