Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / managed_mode / custodian_profile_downloader_service_factory.cc
blobcf5b04e6b4b0072e7baef97354cb274a825f87aa
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/managed_mode/custodian_profile_downloader_service_factory.h"
7 #include "chrome/browser/managed_mode/custodian_profile_downloader_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
10 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
12 // static
13 CustodianProfileDownloaderService*
14 CustodianProfileDownloaderServiceFactory::GetForProfile(
15 Profile* profile) {
16 return static_cast<CustodianProfileDownloaderService*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true));
20 // static
21 CustodianProfileDownloaderServiceFactory*
22 CustodianProfileDownloaderServiceFactory::GetInstance() {
23 return Singleton<CustodianProfileDownloaderServiceFactory>::get();
26 CustodianProfileDownloaderServiceFactory::
27 CustodianProfileDownloaderServiceFactory()
28 : BrowserContextKeyedServiceFactory(
29 "CustodianProfileDownloaderService",
30 BrowserContextDependencyManager::GetInstance()) {
31 // Indirect dependency via ProfileDownloader.
32 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
35 CustodianProfileDownloaderServiceFactory::
36 ~CustodianProfileDownloaderServiceFactory() {}
38 BrowserContextKeyedService*
39 CustodianProfileDownloaderServiceFactory::BuildServiceInstanceFor(
40 content::BrowserContext* profile) const {
41 return new CustodianProfileDownloaderService(static_cast<Profile*>(profile));