Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM
[chromium-blink-merge.git] / chrome / browser / supervised_user / supervised_user_sync_service_factory.cc
blobed2f3fb83eb2545faf9d7e3d6d00ce03667df22c
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"
11 // static
12 SupervisedUserSyncService* SupervisedUserSyncServiceFactory::GetForProfile(
13 Profile* profile) {
14 return static_cast<SupervisedUserSyncService*>(
15 GetInstance()->GetServiceForBrowserContext(profile, true));
18 // static
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());