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 "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile_dependency_manager.h" | 8 #include "chrome/browser/profiles/profile_dependency_manager.h" |
9 #include "chrome/browser/signin/signin_manager.h" | 9 #include "chrome/browser/signin/signin_manager.h" |
10 #include "chrome/browser/signin/token_service_factory.h" | 10 #include "chrome/browser/signin/token_service_factory.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 SigninManager* SigninManagerFactory::GetForProfileIfExists(Profile* profile) { | 28 SigninManager* SigninManagerFactory::GetForProfileIfExists(Profile* profile) { |
29 return static_cast<SigninManager*>( | 29 return static_cast<SigninManager*>( |
30 GetInstance()->GetServiceForProfile(profile, false)); | 30 GetInstance()->GetServiceForProfile(profile, false)); |
31 } | 31 } |
32 | 32 |
33 // static | 33 // static |
34 SigninManagerFactory* SigninManagerFactory::GetInstance() { | 34 SigninManagerFactory* SigninManagerFactory::GetInstance() { |
35 return Singleton<SigninManagerFactory>::get(); | 35 return Singleton<SigninManagerFactory>::get(); |
36 } | 36 } |
37 | 37 |
38 void SigninManagerFactory::RegisterUserPrefs(PrefService* user_prefs) { | 38 void SigninManagerFactory::RegisterUserPrefs(PrefServiceSyncable* user_prefs) { |
39 user_prefs->RegisterStringPref(prefs::kGoogleServicesLastUsername, "", | 39 user_prefs->RegisterStringPref(prefs::kGoogleServicesLastUsername, "", |
40 PrefService::UNSYNCABLE_PREF); | 40 PrefServiceSyncable::UNSYNCABLE_PREF); |
41 user_prefs->RegisterStringPref(prefs::kGoogleServicesUsername, "", | 41 user_prefs->RegisterStringPref(prefs::kGoogleServicesUsername, "", |
42 PrefService::UNSYNCABLE_PREF); | 42 PrefServiceSyncable::UNSYNCABLE_PREF); |
43 user_prefs->RegisterBooleanPref(prefs::kAutologinEnabled, true, | 43 user_prefs->RegisterBooleanPref(prefs::kAutologinEnabled, true, |
44 PrefService::UNSYNCABLE_PREF); | 44 PrefServiceSyncable::UNSYNCABLE_PREF); |
45 user_prefs->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true, | 45 user_prefs->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true, |
46 PrefService::UNSYNCABLE_PREF); | 46 PrefServiceSyncable::UNSYNCABLE_PREF); |
47 user_prefs->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, | 47 user_prefs->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, |
48 new ListValue, PrefService::UNSYNCABLE_PREF); | 48 new ListValue, |
| 49 PrefServiceSyncable::UNSYNCABLE_PREF); |
49 user_prefs->RegisterBooleanPref(prefs::kIsGooglePlusUser, false, | 50 user_prefs->RegisterBooleanPref(prefs::kIsGooglePlusUser, false, |
50 PrefService::UNSYNCABLE_PREF); | 51 PrefServiceSyncable::UNSYNCABLE_PREF); |
51 } | 52 } |
52 | 53 |
53 // static | 54 // static |
54 void SigninManagerFactory::RegisterPrefs(PrefService* local_state) { | 55 void SigninManagerFactory::RegisterPrefs(PrefServiceSimple* local_state) { |
55 local_state->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, "", | 56 local_state->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, ""); |
56 PrefService::UNSYNCABLE_PREF); | |
57 } | 57 } |
58 | 58 |
59 ProfileKeyedService* SigninManagerFactory::BuildServiceInstanceFor( | 59 ProfileKeyedService* SigninManagerFactory::BuildServiceInstanceFor( |
60 Profile* profile) const { | 60 Profile* profile) const { |
61 SigninManager* service = new SigninManager(); | 61 SigninManager* service = new SigninManager(); |
62 service->Initialize(profile); | 62 service->Initialize(profile); |
63 return service; | 63 return service; |
64 } | 64 } |
OLD | NEW |