Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / policy / recommendation_restorer_factory.cc
blob59cab9a6a5bed174535fe43306fdf4029a78505e
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.
5 #include "chrome/browser/chromeos/policy/recommendation_restorer_factory.h"
7 #include "chrome/browser/chromeos/policy/recommendation_restorer.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
10 #include "content/public/browser/browser_context.h"
12 namespace policy {
14 // static
15 RecommendationRestorerFactory* RecommendationRestorerFactory::GetInstance() {
16 return Singleton<RecommendationRestorerFactory>::get();
19 // static
20 RecommendationRestorer* RecommendationRestorerFactory::GetForProfile(
21 Profile* profile) {
22 return reinterpret_cast<RecommendationRestorer*>(
23 GetInstance()->GetServiceForBrowserContext(profile, false));
26 BrowserContextKeyedService*
27 RecommendationRestorerFactory::BuildServiceInstanceFor(
28 content::BrowserContext* context) const {
29 return new RecommendationRestorer(static_cast<Profile*>(context));
32 bool RecommendationRestorerFactory::ServiceIsCreatedWithBrowserContext() const {
33 return true;
36 RecommendationRestorerFactory::RecommendationRestorerFactory()
37 : BrowserContextKeyedServiceFactory(
38 "RecommendationRestorer",
39 BrowserContextDependencyManager::GetInstance()) {
42 RecommendationRestorerFactory::~RecommendationRestorerFactory() {
45 } // namespace policy