OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 9 |
| 10 ChromeSigninClientFactory::ChromeSigninClientFactory() |
| 11 : BrowserContextKeyedServiceFactory( |
| 12 "ChromeSigninClient", |
| 13 BrowserContextDependencyManager::GetInstance()) {} |
| 14 |
| 15 ChromeSigninClientFactory::~ChromeSigninClientFactory() {} |
| 16 |
| 17 // static |
| 18 ChromeSigninClient* ChromeSigninClientFactory::GetForProfile(Profile* profile) { |
| 19 return static_cast<ChromeSigninClient*>( |
| 20 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 21 } |
| 22 |
| 23 // static |
| 24 ChromeSigninClientFactory* ChromeSigninClientFactory::GetInstance() { |
| 25 return Singleton<ChromeSigninClientFactory>::get(); |
| 26 } |
| 27 |
| 28 BrowserContextKeyedService* ChromeSigninClientFactory::BuildServiceInstanceFor( |
| 29 content::BrowserContext* context) const { |
| 30 ChromeSigninClient* client = |
| 31 new ChromeSigninClient(static_cast<Profile*>(context)); |
| 32 return client; |
| 33 } |
OLD | NEW |