Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / precache / precache_manager_factory.cc
blobf037d45dfc2025d443334495c10e16f8c731d480
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"
12 namespace precache {
14 // static
15 PrecacheManager* PrecacheManagerFactory::GetForBrowserContext(
16 content::BrowserContext* browser_context) {
17 return static_cast<PrecacheManager*>(
18 GetInstance()->GetServiceForBrowserContext(browser_context, true));
21 // static
22 PrecacheManagerFactory* PrecacheManagerFactory::GetInstance() {
23 return Singleton<PrecacheManagerFactory>::get();
26 PrecacheManagerFactory::PrecacheManagerFactory()
27 : BrowserContextKeyedServiceFactory(
28 "PrecacheManager",
29 BrowserContextDependencyManager::GetInstance()) {
32 PrecacheManagerFactory::~PrecacheManagerFactory() {
35 KeyedService* PrecacheManagerFactory::BuildServiceInstanceFor(
36 content::BrowserContext* browser_context) const {
37 return new PrecacheManager(
38 browser_context,
39 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(
40 browser_context));
43 } // namespace precache