Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / managed_mode / managed_user_shared_settings_service_factory.cc
blob855222894f752d636b6ba69d9ef82d5639046cea
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/managed_mode/managed_user_shared_settings_service_factory.h"
7 #include "chrome/browser/managed_mode/managed_user_shared_settings_service.h"
8 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
9 #include "components/user_prefs/user_prefs.h"
10 #include "content/public/browser/browser_context.h"
12 // static
13 ManagedUserSharedSettingsService*
14 ManagedUserSharedSettingsServiceFactory::GetForBrowserContext(
15 content::BrowserContext* profile) {
16 return static_cast<ManagedUserSharedSettingsService*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true));
20 // static
21 ManagedUserSharedSettingsServiceFactory*
22 ManagedUserSharedSettingsServiceFactory::GetInstance() {
23 return Singleton<ManagedUserSharedSettingsServiceFactory>::get();
26 ManagedUserSharedSettingsServiceFactory::
27 ManagedUserSharedSettingsServiceFactory()
28 : BrowserContextKeyedServiceFactory(
29 "ManagedUserSharedSettingsService",
30 BrowserContextDependencyManager::GetInstance()) {}
32 ManagedUserSharedSettingsServiceFactory::
33 ~ManagedUserSharedSettingsServiceFactory() {}
35 BrowserContextKeyedService*
36 ManagedUserSharedSettingsServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
38 return new ManagedUserSharedSettingsService(
39 user_prefs::UserPrefs::Get(profile));