Chromium Code Reviews| 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 #include "components/signin/core/browser/test_signin_client.h" | |
|
Roger Tawa OOO till Jul 10th
2014/05/27 19:15:38
Is this include needed here?
Mike Lerman
2014/05/27 19:43:03
Done.
| |
| 9 | 10 |
| 10 ChromeSigninClientFactory::ChromeSigninClientFactory() | 11 ChromeSigninClientFactory::ChromeSigninClientFactory() |
| 11 : BrowserContextKeyedServiceFactory( | 12 : BrowserContextKeyedServiceFactory( |
| 12 "ChromeSigninClient", | 13 "ChromeSigninClient", |
| 13 BrowserContextDependencyManager::GetInstance()) {} | 14 BrowserContextDependencyManager::GetInstance()) {} |
| 14 | 15 |
| 15 ChromeSigninClientFactory::~ChromeSigninClientFactory() {} | 16 ChromeSigninClientFactory::~ChromeSigninClientFactory() {} |
| 16 | 17 |
| 17 // static | 18 // static |
| 18 SigninClient* ChromeSigninClientFactory::GetForProfile(Profile* profile) { | 19 SigninClient* ChromeSigninClientFactory::GetForProfile(Profile* profile) { |
| 19 return static_cast<SigninClient*>( | 20 return static_cast<SigninClient*>( |
| 20 GetInstance()->GetServiceForBrowserContext(profile, true)); | 21 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 21 } | 22 } |
| 22 | 23 |
| 23 // static | 24 // static |
| 24 ChromeSigninClientFactory* ChromeSigninClientFactory::GetInstance() { | 25 ChromeSigninClientFactory* ChromeSigninClientFactory::GetInstance() { |
| 25 return Singleton<ChromeSigninClientFactory>::get(); | 26 return Singleton<ChromeSigninClientFactory>::get(); |
| 26 } | 27 } |
| 27 | 28 |
| 28 KeyedService* ChromeSigninClientFactory::BuildServiceInstanceFor( | 29 KeyedService* ChromeSigninClientFactory::BuildServiceInstanceFor( |
| 29 content::BrowserContext* context) const { | 30 content::BrowserContext* context) const { |
| 30 ChromeSigninClient* client = | 31 ChromeSigninClient* client = |
| 31 new ChromeSigninClient(static_cast<Profile*>(context)); | 32 new ChromeSigninClient(static_cast<Profile*>(context)); |
| 32 return client; | 33 return client; |
| 33 } | 34 } |
| OLD | NEW |