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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 5976005: show notification on locale change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 9 years, 11 months 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
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index d4f24d890c29ce168bf401d43e547364158f5b2e..4a60cd113caab4869c85592f8404aec2bf4a26e0 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -1340,6 +1340,30 @@ PromoCounter* ProfileImpl::GetInstantPromoCounter() {
}
#if defined(OS_CHROMEOS)
+void ProfileImpl::ChangeApplicationLocale(
+ const std::string& locale, bool keep_local) {
+ if (locale.empty()) {
+ NOTREACHED();
+ return;
+ }
+ if (keep_local) {
+ GetPrefs()->SetString(prefs::kApplicationLocaleOverride, locale);
+ } else {
+ GetPrefs()->SetString(prefs::kApplicationLocale, locale);
+ GetPrefs()->SetString(prefs::kApplicationLocaleOverride, "");
+ }
+ GetPrefs()->SetString(prefs::kApplicationLocaleBackup, locale);
+ GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted);
+ // 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.
+ g_browser_process->local_state()->SetString(
+ prefs::kApplicationLocale, locale);
+
+ GetPrefs()->SavePersistentPrefs();
+ g_browser_process->local_state()->SavePersistentPrefs();
+}
+
chromeos::ProxyConfigServiceImpl*
ProfileImpl::GetChromeOSProxyConfigServiceImpl() {
if (!chromeos_proxy_config_service_impl_) {

Powered by Google App Engine
This is Rietveld 408576698