OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/chrome_signin_client_factory.h" | 5 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
9 | 9 |
10 ChromeSigninClientFactory::ChromeSigninClientFactory() | 10 ChromeSigninClientFactory::ChromeSigninClientFactory() |
11 : BrowserContextKeyedServiceFactory( | 11 : BrowserContextKeyedServiceFactory( |
12 "ChromeSigninClient", | 12 "ChromeSigninClient", |
13 BrowserContextDependencyManager::GetInstance()) {} | 13 BrowserContextDependencyManager::GetInstance()) {} |
14 | 14 |
15 ChromeSigninClientFactory::~ChromeSigninClientFactory() {} | 15 ChromeSigninClientFactory::~ChromeSigninClientFactory() {} |
16 | 16 |
17 // static | 17 // static |
18 ChromeSigninClient* ChromeSigninClientFactory::GetForProfile(Profile* profile) { | 18 SigninClient* ChromeSigninClientFactory::GetForProfile(Profile* profile) { |
19 return static_cast<ChromeSigninClient*>( | 19 return static_cast<SigninClient*>( |
20 GetInstance()->GetServiceForBrowserContext(profile, true)); | 20 GetInstance()->GetServiceForBrowserContext(profile, true)); |
21 } | 21 } |
22 | 22 |
23 // static | 23 // static |
24 ChromeSigninClientFactory* ChromeSigninClientFactory::GetInstance() { | 24 ChromeSigninClientFactory* ChromeSigninClientFactory::GetInstance() { |
25 return Singleton<ChromeSigninClientFactory>::get(); | 25 return Singleton<ChromeSigninClientFactory>::get(); |
26 } | 26 } |
27 | 27 |
28 KeyedService* ChromeSigninClientFactory::BuildServiceInstanceFor( | 28 KeyedService* ChromeSigninClientFactory::BuildServiceInstanceFor( |
29 content::BrowserContext* context) const { | 29 content::BrowserContext* context) const { |
30 ChromeSigninClient* client = | 30 ChromeSigninClient* client = |
31 new ChromeSigninClient(static_cast<Profile*>(context)); | 31 new ChromeSigninClient(static_cast<Profile*>(context)); |
32 return client; | 32 return client; |
33 } | 33 } |
OLD | NEW |