Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/supervised_user/child_accounts/child_account_service_factory.cc

Issue 783083002: Add support for child accounts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove CrOS for now Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698