Chromium Code Reviews| 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_) { |