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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 23095006: If user profile doesn't contain language setting, default to his Google account settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_downloader_unittest.cc ('k') | ui/base/l10n/l10n_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } else { 1061 } else {
1062 std::string cur_locale = g_browser_process->GetApplicationLocale(); 1062 std::string cur_locale = g_browser_process->GetApplicationLocale();
1063 std::string backup_locale = 1063 std::string backup_locale =
1064 GetPrefs()->GetString(prefs::kApplicationLocaleBackup); 1064 GetPrefs()->GetString(prefs::kApplicationLocaleBackup);
1065 // Profile synchronization takes time and is not completed at that 1065 // Profile synchronization takes time and is not completed at that
1066 // moment at first login. So we initialize locale preference in steps: 1066 // moment at first login. So we initialize locale preference in steps:
1067 // (1) first save it to temporary backup; 1067 // (1) first save it to temporary backup;
1068 // (2) on next login we assume that synchronization is already completed 1068 // (2) on next login we assume that synchronization is already completed
1069 // and we may finalize initialization. 1069 // and we may finalize initialization.
1070 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, cur_locale); 1070 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, cur_locale);
1071 if (!backup_locale.empty()) 1071 if (!new_locale.empty())
1072 GetPrefs()->SetString(prefs::kApplicationLocale, new_locale);
1073 else if (!backup_locale.empty())
1072 GetPrefs()->SetString(prefs::kApplicationLocale, backup_locale); 1074 GetPrefs()->SetString(prefs::kApplicationLocale, backup_locale);
1073 do_update_pref = false; 1075 do_update_pref = false;
1074 } 1076 }
1075 break; 1077 break;
1076 } 1078 }
1077 case APP_LOCALE_CHANGED_VIA_UNKNOWN: 1079 case APP_LOCALE_CHANGED_VIA_UNKNOWN:
1078 default: { 1080 default: {
1079 NOTREACHED(); 1081 NOTREACHED();
1080 break; 1082 break;
1081 } 1083 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1203 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1202 #if defined(OS_CHROMEOS) 1204 #if defined(OS_CHROMEOS)
1203 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1205 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
1204 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1206 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1205 g_browser_process->local_state()); 1207 g_browser_process->local_state());
1206 } 1208 }
1207 #endif // defined(OS_CHROMEOS) 1209 #endif // defined(OS_CHROMEOS)
1208 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1210 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1209 GetPrefs(), g_browser_process->local_state()); 1211 GetPrefs(), g_browser_process->local_state());
1210 } 1212 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_downloader_unittest.cc ('k') | ui/base/l10n/l10n_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698