OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/account_tracker_service_factory.h" | 5 #include "chrome/browser/signin/account_tracker_service_factory.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 9 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 GetInstance()->GetServiceForBrowserContext(profile, true)); | 32 GetInstance()->GetServiceForBrowserContext(profile, true)); |
33 } | 33 } |
34 | 34 |
35 // static | 35 // static |
36 AccountTrackerServiceFactory* AccountTrackerServiceFactory::GetInstance() { | 36 AccountTrackerServiceFactory* AccountTrackerServiceFactory::GetInstance() { |
37 return Singleton<AccountTrackerServiceFactory>::get(); | 37 return Singleton<AccountTrackerServiceFactory>::get(); |
38 } | 38 } |
39 | 39 |
40 void AccountTrackerServiceFactory::RegisterProfilePrefs( | 40 void AccountTrackerServiceFactory::RegisterProfilePrefs( |
41 user_prefs::PrefRegistrySyncable* registry) { | 41 user_prefs::PrefRegistrySyncable* registry) { |
42 registry->RegisterListPref( | 42 registry->RegisterListPref(AccountTrackerService::kAccountInfoPref); |
43 AccountTrackerService::kAccountInfoPref, | 43 registry->RegisterIntegerPref(prefs::kAccountIdMigrationState, |
44 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 44 AccountTrackerService::MIGRATION_NOT_STARTED); |
45 registry->RegisterIntegerPref( | |
46 prefs::kAccountIdMigrationState, | |
47 AccountTrackerService::MIGRATION_NOT_STARTED, | |
48 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
49 } | 45 } |
50 | 46 |
51 KeyedService* AccountTrackerServiceFactory::BuildServiceInstanceFor( | 47 KeyedService* AccountTrackerServiceFactory::BuildServiceInstanceFor( |
52 content::BrowserContext* context) const { | 48 content::BrowserContext* context) const { |
53 Profile* profile = static_cast<Profile*>(context); | 49 Profile* profile = static_cast<Profile*>(context); |
54 AccountTrackerService* service = new AccountTrackerService(); | 50 AccountTrackerService* service = new AccountTrackerService(); |
55 service->Initialize( | 51 service->Initialize( |
56 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 52 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
57 ChromeSigninClientFactory::GetForProfile(profile)); | 53 ChromeSigninClientFactory::GetForProfile(profile)); |
58 return service; | 54 return service; |
59 } | 55 } |
OLD | NEW |