| 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/signin/signin_manager_factory.h" | 5 #include "chrome/browser/signin/signin_manager_factory.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/account_tracker_service_factory.h" | 10 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 // static | 77 // static |
| 78 SigninManagerFactory* SigninManagerFactory::GetInstance() { | 78 SigninManagerFactory* SigninManagerFactory::GetInstance() { |
| 79 return Singleton<SigninManagerFactory>::get(); | 79 return Singleton<SigninManagerFactory>::get(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void SigninManagerFactory::RegisterProfilePrefs( | 82 void SigninManagerFactory::RegisterProfilePrefs( |
| 83 user_prefs::PrefRegistrySyncable* registry) { | 83 user_prefs::PrefRegistrySyncable* registry) { |
| 84 registry->RegisterStringPref( | 84 registry->RegisterStringPref(prefs::kGoogleServicesHostedDomain, |
| 85 prefs::kGoogleServicesHostedDomain, | 85 std::string()); |
| 86 std::string(), | 86 registry->RegisterStringPref(prefs::kGoogleServicesLastUsername, |
| 87 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 87 std::string()); |
| 88 registry->RegisterStringPref( | |
| 89 prefs::kGoogleServicesLastUsername, | |
| 90 std::string(), | |
| 91 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 92 registry->RegisterInt64Pref( | 88 registry->RegisterInt64Pref( |
| 93 prefs::kGoogleServicesRefreshTokenAnnotateScheduledTime, | 89 prefs::kGoogleServicesRefreshTokenAnnotateScheduledTime, |
| 94 base::Time().ToInternalValue(), | 90 base::Time().ToInternalValue()); |
| 95 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 91 registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, |
| 96 registry->RegisterStringPref( | 92 std::string()); |
| 97 prefs::kGoogleServicesSigninScopedDeviceId, | 93 registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string()); |
| 98 std::string(), | 94 registry->RegisterStringPref(prefs::kGoogleServicesUserAccountId, |
| 99 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 95 std::string()); |
| 100 registry->RegisterStringPref( | 96 registry->RegisterBooleanPref(prefs::kAutologinEnabled, true); |
| 101 prefs::kGoogleServicesAccountId, | 97 registry->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true); |
| 102 std::string(), | |
| 103 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 104 registry->RegisterStringPref( | |
| 105 prefs::kGoogleServicesUserAccountId, | |
| 106 std::string(), | |
| 107 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 108 registry->RegisterBooleanPref( | |
| 109 prefs::kAutologinEnabled, | |
| 110 true, | |
| 111 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 112 registry->RegisterBooleanPref( | |
| 113 prefs::kReverseAutologinEnabled, | |
| 114 true, | |
| 115 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 116 registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, | 98 registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, |
| 117 new base::ListValue, | 99 new base::ListValue); |
| 118 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 100 registry->RegisterInt64Pref(prefs::kSignedInTime, |
| 119 registry->RegisterInt64Pref( | 101 base::Time().ToInternalValue()); |
| 120 prefs::kSignedInTime, | |
| 121 base::Time().ToInternalValue(), | |
| 122 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 123 | 102 |
| 124 LocalAuth::RegisterLocalAuthPrefs(registry); | 103 LocalAuth::RegisterLocalAuthPrefs(registry); |
| 125 | 104 |
| 126 // Deprecated prefs: will be removed in a future release. | 105 // Deprecated prefs: will be removed in a future release. |
| 127 registry->RegisterStringPref( | 106 registry->RegisterStringPref(prefs::kGoogleServicesUsername, std::string()); |
| 128 prefs::kGoogleServicesUsername, | |
| 129 std::string(), | |
| 130 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 131 } | 107 } |
| 132 | 108 |
| 133 // static | 109 // static |
| 134 void SigninManagerFactory::RegisterPrefs(PrefRegistrySimple* registry) { | 110 void SigninManagerFactory::RegisterPrefs(PrefRegistrySimple* registry) { |
| 135 registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, | 111 registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, |
| 136 std::string()); | 112 std::string()); |
| 137 } | 113 } |
| 138 | 114 |
| 139 void SigninManagerFactory::AddObserver(Observer* observer) { | 115 void SigninManagerFactory::AddObserver(Observer* observer) { |
| 140 observer_list_.AddObserver(observer); | 116 observer_list_.AddObserver(observer); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 148 } |
| 173 | 149 |
| 174 void SigninManagerFactory::BrowserContextShutdown( | 150 void SigninManagerFactory::BrowserContextShutdown( |
| 175 content::BrowserContext* context) { | 151 content::BrowserContext* context) { |
| 176 SigninManagerBase* manager = static_cast<SigninManagerBase*>( | 152 SigninManagerBase* manager = static_cast<SigninManagerBase*>( |
| 177 GetServiceForBrowserContext(context, false)); | 153 GetServiceForBrowserContext(context, false)); |
| 178 if (manager) | 154 if (manager) |
| 179 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerShutdown(manager)); | 155 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerShutdown(manager)); |
| 180 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); | 156 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); |
| 181 } | 157 } |
| OLD | NEW |