| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |