QUIC - cleanup changes to sync chromium tree with internal source.
[chromium-blink-merge.git] / chrome / browser / supervised_user / legacy / custodian_profile_downloader_service_factory.cc
blobb191eaf9d1929c51bda12b39c1e9a0c5df301bd8
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/legacy/custodian_profile_downloader_service_factory.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 // static
14 CustodianProfileDownloaderService*
15 CustodianProfileDownloaderServiceFactory::GetForProfile(
16 Profile* profile) {
17 return static_cast<CustodianProfileDownloaderService*>(
18 GetInstance()->GetServiceForBrowserContext(profile, true));
21 // static
22 CustodianProfileDownloaderServiceFactory*
23 CustodianProfileDownloaderServiceFactory::GetInstance() {
24 return Singleton<CustodianProfileDownloaderServiceFactory>::get();
27 CustodianProfileDownloaderServiceFactory::
28 CustodianProfileDownloaderServiceFactory()
29 : BrowserContextKeyedServiceFactory(
30 "CustodianProfileDownloaderService",
31 BrowserContextDependencyManager::GetInstance()) {
32 // Indirect dependency via ProfileDownloader.
33 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
34 DependsOn(SigninManagerFactory::GetInstance());
37 CustodianProfileDownloaderServiceFactory::
38 ~CustodianProfileDownloaderServiceFactory() {}
40 KeyedService* CustodianProfileDownloaderServiceFactory::BuildServiceInstanceFor(
41 content::BrowserContext* profile) const {
42 return new CustodianProfileDownloaderService(static_cast<Profile*>(profile));