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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 case APP_LOCALE_CHANGED_VIA_SETTINGS: | 1060 case APP_LOCALE_CHANGED_VIA_SETTINGS: |
1061 case APP_LOCALE_CHANGED_VIA_REVERT: { | 1061 case APP_LOCALE_CHANGED_VIA_REVERT: { |
1062 // We keep kApplicationLocaleBackup value as a reference. In case value | 1062 // We keep kApplicationLocaleBackup value as a reference. In case value |
1063 // of kApplicationLocale preference would change due to sync from other | 1063 // of kApplicationLocale preference would change due to sync from other |
1064 // device then kApplicationLocaleBackup value will trigger and allow us to | 1064 // device then kApplicationLocaleBackup value will trigger and allow us to |
1065 // show notification about automatic locale change in LocaleChangeGuard. | 1065 // show notification about automatic locale change in LocaleChangeGuard. |
1066 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, new_locale); | 1066 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, new_locale); |
1067 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted); | 1067 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted); |
1068 // We maintain kApplicationLocale property in both a global storage | 1068 // We maintain kApplicationLocale property in both a global storage |
1069 // and user's profile. Global property determines locale of login screen, | 1069 // and user's profile. Global property determines locale of login screen, |
1070 // while user's profile determines his personal locale preference. | 1070 // while user's profile determines their personal locale preference. |
1071 break; | 1071 break; |
1072 } | 1072 } |
1073 case APP_LOCALE_CHANGED_VIA_LOGIN: | 1073 case APP_LOCALE_CHANGED_VIA_LOGIN: |
1074 case APP_LOCALE_CHANGED_VIA_PUBLIC_SESSION_LOGIN: { | 1074 case APP_LOCALE_CHANGED_VIA_PUBLIC_SESSION_LOGIN: { |
1075 if (!pref_locale.empty()) { | 1075 if (!pref_locale.empty()) { |
1076 DCHECK(pref_locale == new_locale); | 1076 DCHECK(pref_locale == new_locale); |
1077 std::string accepted_locale = | 1077 std::string accepted_locale = |
1078 GetPrefs()->GetString(prefs::kApplicationLocaleAccepted); | 1078 GetPrefs()->GetString(prefs::kApplicationLocaleAccepted); |
1079 if (accepted_locale == new_locale) { | 1079 if (accepted_locale == new_locale) { |
1080 // If locale is accepted then we do not want to show LocaleChange | 1080 // If locale is accepted then we do not want to show LocaleChange |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1271 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1272 domain_reliability::DomainReliabilityService* service = | 1272 domain_reliability::DomainReliabilityService* service = |
1273 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1273 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1274 GetForBrowserContext(this); | 1274 GetForBrowserContext(this); |
1275 if (!service) | 1275 if (!service) |
1276 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1276 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1277 | 1277 |
1278 return service->CreateMonitor( | 1278 return service->CreateMonitor( |
1279 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1279 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
1280 } | 1280 } |
OLD | NEW |