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/about_signin_internals_factory.h" | 5 #include "chrome/browser/signin/about_signin_internals_factory.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/signin/account_tracker_service_factory.h" | 9 #include "chrome/browser/signin/account_tracker_service_factory.h" |
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 10 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 12 #include "chrome/browser/signin/signin_error_controller_factory.h" |
12 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
13 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
14 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 15 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
15 #include "components/pref_registry/pref_registry_syncable.h" | 16 #include "components/pref_registry/pref_registry_syncable.h" |
16 #include "components/signin/core/browser/about_signin_internals.h" | 17 #include "components/signin/core/browser/about_signin_internals.h" |
17 #include "components/signin/core/browser/signin_internals_util.h" | 18 #include "components/signin/core/browser/signin_internals_util.h" |
18 #include "components/signin/core/browser/signin_manager.h" | 19 #include "components/signin/core/browser/signin_manager.h" |
19 #include "google_apis/gaia/gaia_constants.h" | 20 #include "google_apis/gaia/gaia_constants.h" |
20 | 21 |
21 using namespace signin_internals_util; | 22 using namespace signin_internals_util; |
22 | 23 |
23 AboutSigninInternalsFactory::AboutSigninInternalsFactory() | 24 AboutSigninInternalsFactory::AboutSigninInternalsFactory() |
24 : BrowserContextKeyedServiceFactory( | 25 : BrowserContextKeyedServiceFactory( |
25 "AboutSigninInternals", | 26 "AboutSigninInternals", |
26 BrowserContextDependencyManager::GetInstance()) { | 27 BrowserContextDependencyManager::GetInstance()) { |
27 DependsOn(AccountTrackerServiceFactory::GetInstance()); | 28 DependsOn(AccountTrackerServiceFactory::GetInstance()); |
28 DependsOn(ChromeSigninClientFactory::GetInstance()); | 29 DependsOn(ChromeSigninClientFactory::GetInstance()); |
29 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | 30 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 31 DependsOn(SigninErrorControllerFactory::GetInstance()); |
30 DependsOn(SigninManagerFactory::GetInstance()); | 32 DependsOn(SigninManagerFactory::GetInstance()); |
31 } | 33 } |
32 | 34 |
33 AboutSigninInternalsFactory::~AboutSigninInternalsFactory() {} | 35 AboutSigninInternalsFactory::~AboutSigninInternalsFactory() {} |
34 | 36 |
35 // static | 37 // static |
36 AboutSigninInternals* AboutSigninInternalsFactory::GetForProfile( | 38 AboutSigninInternals* AboutSigninInternalsFactory::GetForProfile( |
37 Profile* profile) { | 39 Profile* profile) { |
38 return static_cast<AboutSigninInternals*>( | 40 return static_cast<AboutSigninInternals*>( |
39 GetInstance()->GetServiceForBrowserContext(profile, true)); | 41 GetInstance()->GetServiceForBrowserContext(profile, true)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 77 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
76 } | 78 } |
77 } | 79 } |
78 | 80 |
79 KeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( | 81 KeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( |
80 content::BrowserContext* context) const { | 82 content::BrowserContext* context) const { |
81 Profile* profile = Profile::FromBrowserContext(context); | 83 Profile* profile = Profile::FromBrowserContext(context); |
82 AboutSigninInternals* service = new AboutSigninInternals( | 84 AboutSigninInternals* service = new AboutSigninInternals( |
83 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 85 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
84 AccountTrackerServiceFactory::GetForProfile(profile), | 86 AccountTrackerServiceFactory::GetForProfile(profile), |
85 SigninManagerFactory::GetForProfile(profile)); | 87 SigninManagerFactory::GetForProfile(profile), |
| 88 SigninErrorControllerFactory::GetForProfile(profile)); |
86 service->Initialize(ChromeSigninClientFactory::GetForProfile(profile)); | 89 service->Initialize(ChromeSigninClientFactory::GetForProfile(profile)); |
87 return service; | 90 return service; |
88 } | 91 } |
OLD | NEW |