Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / supervised_user / child_accounts / child_account_service_factory.cc
blob4a489467ea732c058660e3bec450d2aa422802e7
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.
5 #include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/account_tracker_service_factory.h"
9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
11 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
12 #include "components/keyed_service/content/browser_context_dependency_manager.h"
14 // static
15 ChildAccountService* ChildAccountServiceFactory::GetForProfile(
16 Profile* profile) {
17 return static_cast<ChildAccountService*>(
18 GetInstance()->GetServiceForBrowserContext(profile, true));
21 // static
22 ChildAccountServiceFactory* ChildAccountServiceFactory::GetInstance() {
23 return Singleton<ChildAccountServiceFactory>::get();
26 ChildAccountServiceFactory::ChildAccountServiceFactory()
27 : BrowserContextKeyedServiceFactory(
28 "ChildAccountService",
29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(AccountTrackerServiceFactory::GetInstance());
31 DependsOn(SigninManagerFactory::GetInstance());
32 DependsOn(SupervisedUserServiceFactory::GetInstance());
35 ChildAccountServiceFactory::~ChildAccountServiceFactory() {}
37 KeyedService* ChildAccountServiceFactory::BuildServiceInstanceFor(
38 content::BrowserContext* profile) const {
39 return new ChildAccountService(static_cast<Profile*>(profile));