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