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. 4 5#include "chrome/browser/supervised_user/custodian_profile_downloader_service_factory.h" 6 7#include "chrome/browser/profiles/profile.h" 8#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 9#include "chrome/browser/supervised_user/custodian_profile_downloader_service.h" 10#include "components/keyed_service/content/browser_context_dependency_manager.h" 11 12// static 13CustodianProfileDownloaderService* 14CustodianProfileDownloaderServiceFactory::GetForProfile( 15 Profile* profile) { 16 return static_cast<CustodianProfileDownloaderService*>( 17 GetInstance()->GetServiceForBrowserContext(profile, true)); 18} 19 20// static 21CustodianProfileDownloaderServiceFactory* 22CustodianProfileDownloaderServiceFactory::GetInstance() { 23 return Singleton<CustodianProfileDownloaderServiceFactory>::get(); 24} 25 26CustodianProfileDownloaderServiceFactory:: 27CustodianProfileDownloaderServiceFactory() 28 : BrowserContextKeyedServiceFactory( 29 "CustodianProfileDownloaderService", 30 BrowserContextDependencyManager::GetInstance()) { 31 // Indirect dependency via ProfileDownloader. 32 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); 33} 34 35CustodianProfileDownloaderServiceFactory:: 36~CustodianProfileDownloaderServiceFactory() {} 37 38KeyedService* CustodianProfileDownloaderServiceFactory::BuildServiceInstanceFor( 39 content::BrowserContext* profile) const { 40 return new CustodianProfileDownloaderService(static_cast<Profile*>(profile)); 41} 42 43