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/precache/precache_manager_factory.h"
7 #include "chrome/browser/sync/profile_sync_service_factory.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "components/precache/content/precache_manager.h"
10 #include "content/public/browser/browser_context.h"
15 PrecacheManager
* PrecacheManagerFactory::GetForBrowserContext(
16 content::BrowserContext
* browser_context
) {
17 return static_cast<PrecacheManager
*>(
18 GetInstance()->GetServiceForBrowserContext(browser_context
, true));
22 PrecacheManagerFactory
* PrecacheManagerFactory::GetInstance() {
23 return Singleton
<PrecacheManagerFactory
>::get();
26 PrecacheManagerFactory::PrecacheManagerFactory()
27 : BrowserContextKeyedServiceFactory(
29 BrowserContextDependencyManager::GetInstance()) {
32 PrecacheManagerFactory::~PrecacheManagerFactory() {
35 KeyedService
* PrecacheManagerFactory::BuildServiceInstanceFor(
36 content::BrowserContext
* browser_context
) const {
37 return new PrecacheManager(
39 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(
43 } // namespace precache