| 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/supervised_user/child_accounts/child_account_service_fa
ctory.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 9 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
| 10 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 12 |
| 13 // static |
| 14 ChildAccountService* ChildAccountServiceFactory::GetForProfile( |
| 15 Profile* profile) { |
| 16 return static_cast<ChildAccountService*>( |
| 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 18 } |
| 19 |
| 20 // static |
| 21 ChildAccountServiceFactory* ChildAccountServiceFactory::GetInstance() { |
| 22 return Singleton<ChildAccountServiceFactory>::get(); |
| 23 } |
| 24 |
| 25 ChildAccountServiceFactory::ChildAccountServiceFactory() |
| 26 : BrowserContextKeyedServiceFactory( |
| 27 "ChildAccountService", |
| 28 BrowserContextDependencyManager::GetInstance()) { |
| 29 DependsOn(SupervisedUserServiceFactory::GetInstance()); |
| 30 // Indirect dependency via AccountServiceFlagFetcher. |
| 31 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 32 // TODO(treib): Do we have more dependencies here? |
| 33 } |
| 34 |
| 35 ChildAccountServiceFactory::~ChildAccountServiceFactory() {} |
| 36 |
| 37 KeyedService* ChildAccountServiceFactory::BuildServiceInstanceFor( |
| 38 content::BrowserContext* profile) const { |
| 39 return new ChildAccountService(static_cast<Profile*>(profile)); |
| 40 } |
| OLD | NEW |