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/supervised_user_sync_service_factory.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/supervised_user/supervised_user_sync_service.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 SupervisedUserSyncService
* SupervisedUserSyncServiceFactory::GetForProfile(
14 return static_cast<SupervisedUserSyncService
*>(
15 GetInstance()->GetServiceForBrowserContext(profile
, true));
19 SupervisedUserSyncServiceFactory
*
20 SupervisedUserSyncServiceFactory::GetInstance() {
21 return Singleton
<SupervisedUserSyncServiceFactory
>::get();
24 SupervisedUserSyncServiceFactory::SupervisedUserSyncServiceFactory()
25 : BrowserContextKeyedServiceFactory(
26 "SupervisedUserSyncService",
27 BrowserContextDependencyManager::GetInstance()) {
30 SupervisedUserSyncServiceFactory::~SupervisedUserSyncServiceFactory() {}
32 KeyedService
* SupervisedUserSyncServiceFactory::BuildServiceInstanceFor(
33 content::BrowserContext
* profile
) const {
34 return new SupervisedUserSyncService(
35 static_cast<Profile
*>(profile
)->GetPrefs());