Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc

Issue 2864293003: [Offline Pages] Add a GCMAppHandler for offline page prefetch. (Closed)
Patch Set: Fix windows Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/offline_pages/prefetch/prefetch_service_factory.h ('k') | components/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/offline_pages/content/prefetch_service_factory.h" 5 #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h"
9 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" 11 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h"
10 #include "content/public/browser/browser_context.h" 12 #include "content/public/browser/browser_context.h"
11 13
12 namespace offline_pages { 14 namespace offline_pages {
13 15
14 PrefetchServiceFactory::PrefetchServiceFactory() 16 PrefetchServiceFactory::PrefetchServiceFactory()
15 : BrowserContextKeyedServiceFactory( 17 : BrowserContextKeyedServiceFactory(
16 "OfflinePagePrefetchService", 18 "OfflinePagePrefetchService",
17 BrowserContextDependencyManager::GetInstance()) {} 19 BrowserContextDependencyManager::GetInstance()) {}
18
19 // static 20 // static
20 PrefetchServiceFactory* PrefetchServiceFactory::GetInstance() { 21 PrefetchServiceFactory* PrefetchServiceFactory::GetInstance() {
21 return base::Singleton<PrefetchServiceFactory>::get(); 22 return base::Singleton<PrefetchServiceFactory>::get();
22 } 23 }
23 24
24 // static 25 // static
25 PrefetchService* PrefetchServiceFactory::GetForBrowserContext( 26 PrefetchService* PrefetchServiceFactory::GetForBrowserContext(
26 content::BrowserContext* context) { 27 content::BrowserContext* context) {
27 return static_cast<PrefetchService*>( 28 return static_cast<PrefetchService*>(
28 GetInstance()->GetServiceForBrowserContext(context, true)); 29 GetInstance()->GetServiceForBrowserContext(context, true));
29 } 30 }
30 31
31 KeyedService* PrefetchServiceFactory::BuildServiceInstanceFor( 32 KeyedService* PrefetchServiceFactory::BuildServiceInstanceFor(
32 content::BrowserContext* context) const { 33 content::BrowserContext* context) const {
33 return new PrefetchServiceImpl(); 34 return new PrefetchServiceImpl(base::MakeUnique<PrefetchGCMAppHandler>());
34 } 35 }
35 36
36 } // namespace offline_pages 37 } // namespace offline_pages
OLDNEW
« no previous file with comments | « chrome/browser/offline_pages/prefetch/prefetch_service_factory.h ('k') | components/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698