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

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: year 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 0f2bf3c159bfffb084c1a0ccddee6a4ea69d0449..5756fbec3bbf99f0fc12530563929cb5dcc55b56 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -1340,6 +1340,32 @@ PromoCounter* ProfileImpl::GetInstantPromoCounter() {
}
#if defined(OS_CHROMEOS)
+void ProfileImpl::ChangeApplicationLocale(
+ const std::string& locale, bool dont_sync) {
whywhat 2011/01/11 10:24:14 Why not use positive name, smth like sync? Though
Denis Lagno 2011/01/12 15:33:28 OK. I switched back to "keep_local". It was origi
+ if (locale.empty()) {
+ NOTREACHED();
+ return;
+ }
+ // 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[] = {
whywhat 2011/01/11 10:24:14 I don't think using array is justified but the sma
Denis Lagno 2011/01/12 15:33:28 Done.
+ GetPrefs(),
+ g_browser_process->local_state()
+ };
+ if (dont_sync) {
+ prefs[0]->SetString(prefs::kApplicationLocaleOverride, locale);
+ } else {
+ prefs[0]->SetString(prefs::kApplicationLocale, locale);
+ prefs[0]->SetString(prefs::kApplicationLocaleOverride, "");
+ }
+ prefs[0]->SetString(prefs::kApplicationLocaleBackup, locale);
+ prefs[0]->ClearPref(prefs::kApplicationLocaleAccepted);
+ prefs[1]->SetString(prefs::kApplicationLocale, locale);
+ for (size_t i = 0; i < arraysize(prefs); ++i)
+ prefs[i]->SavePersistentPrefs();
+}
+
chromeos::ProxyConfigServiceImpl*
ProfileImpl::GetChromeOSProxyConfigServiceImpl() {
if (!chromeos_proxy_config_service_impl_) {

Powered by Google App Engine
This is Rietveld 408576698