- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / managed_mode / managed_user_sync_service_factory.cc
1 // Copyright 2013 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/managed_mode/managed_user_sync_service_factory.h"
6
7 #include "chrome/browser/managed_mode/managed_user_sync_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
10
11 // static
12 ManagedUserSyncService* ManagedUserSyncServiceFactory::GetForProfile(
13     Profile* profile) {
14   return static_cast<ManagedUserSyncService*>(
15       GetInstance()->GetServiceForBrowserContext(profile, true));
16 }
17
18 // static
19 ManagedUserSyncServiceFactory* ManagedUserSyncServiceFactory::GetInstance() {
20   return Singleton<ManagedUserSyncServiceFactory>::get();
21 }
22
23 ManagedUserSyncServiceFactory::ManagedUserSyncServiceFactory()
24     : BrowserContextKeyedServiceFactory(
25           "ManagedUserSyncService",
26           BrowserContextDependencyManager::GetInstance()) {
27 }
28
29 ManagedUserSyncServiceFactory::~ManagedUserSyncServiceFactory() {}
30
31 BrowserContextKeyedService*
32 ManagedUserSyncServiceFactory::BuildServiceInstanceFor(
33     content::BrowserContext* profile) const {
34   return new ManagedUserSyncService(static_cast<Profile*>(profile)->GetPrefs());
35 }