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

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 build. 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
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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } else { 1035 } else {
1036 std::string cur_locale = g_browser_process->GetApplicationLocale(); 1036 std::string cur_locale = g_browser_process->GetApplicationLocale();
1037 std::string backup_locale = 1037 std::string backup_locale =
1038 GetPrefs()->GetString(prefs::kApplicationLocaleBackup); 1038 GetPrefs()->GetString(prefs::kApplicationLocaleBackup);
1039 // Profile synchronization takes time and is not completed at that 1039 // Profile synchronization takes time and is not completed at that
1040 // moment at first login. So we initialize locale preference in steps: 1040 // moment at first login. So we initialize locale preference in steps:
1041 // (1) first save it to temporary backup; 1041 // (1) first save it to temporary backup;
1042 // (2) on next login we assume that synchronization is already completed 1042 // (2) on next login we assume that synchronization is already completed
1043 // and we may finalize initialization. 1043 // and we may finalize initialization.
1044 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, cur_locale); 1044 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, cur_locale);
1045 if (!backup_locale.empty()) 1045 if (!new_locale.empty())
1046 GetPrefs()->SetString(prefs::kApplicationLocale, new_locale);
1047 else if (!backup_locale.empty())
1046 GetPrefs()->SetString(prefs::kApplicationLocale, backup_locale); 1048 GetPrefs()->SetString(prefs::kApplicationLocale, backup_locale);
1047 do_update_pref = false; 1049 do_update_pref = false;
1048 } 1050 }
1049 break; 1051 break;
1050 } 1052 }
1051 case APP_LOCALE_CHANGED_VIA_UNKNOWN: 1053 case APP_LOCALE_CHANGED_VIA_UNKNOWN:
1052 default: { 1054 default: {
1053 NOTREACHED(); 1055 NOTREACHED();
1054 break; 1056 break;
1055 } 1057 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1177 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1176 #if defined(OS_CHROMEOS) 1178 #if defined(OS_CHROMEOS)
1177 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1179 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
1178 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1180 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1179 g_browser_process->local_state()); 1181 g_browser_process->local_state());
1180 } 1182 }
1181 #endif // defined(OS_CHROMEOS) 1183 #endif // defined(OS_CHROMEOS)
1182 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1184 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1183 GetPrefs(), g_browser_process->local_state()); 1185 GetPrefs(), g_browser_process->local_state());
1184 } 1186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698