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

Side by Side Diff: chrome/browser/precache/precache_manager_factory.cc

Issue 1176253002: Fix IsPrecachingAllowed() to check Sync instead of Data Saver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks per bengr. Created 5 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/precache/precache_manager_factory.h ('k') | chrome/chrome_browser.gypi » ('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 2013 The Chromium Authors. All rights reserved. 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 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/precache/content/precache_manager_factory.h" 5 #include "chrome/browser/precache/precache_manager_factory.h"
6 6
7 #include "chrome/browser/sync/profile_sync_service_factory.h"
7 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "components/precache/content/precache_manager.h" 9 #include "components/precache/content/precache_manager.h"
9 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
10 11
11 namespace precache { 12 namespace precache {
12 13
13 // static 14 // static
14 PrecacheManager* PrecacheManagerFactory::GetForBrowserContext( 15 PrecacheManager* PrecacheManagerFactory::GetForBrowserContext(
15 content::BrowserContext* browser_context) { 16 content::BrowserContext* browser_context) {
16 return static_cast<PrecacheManager*>( 17 return static_cast<PrecacheManager*>(
17 GetInstance()->GetServiceForBrowserContext(browser_context, true)); 18 GetInstance()->GetServiceForBrowserContext(browser_context, true));
18 } 19 }
19 20
20 // static 21 // static
21 PrecacheManagerFactory* PrecacheManagerFactory::GetInstance() { 22 PrecacheManagerFactory* PrecacheManagerFactory::GetInstance() {
22 return Singleton<PrecacheManagerFactory>::get(); 23 return Singleton<PrecacheManagerFactory>::get();
23 } 24 }
24 25
25 PrecacheManagerFactory::PrecacheManagerFactory() 26 PrecacheManagerFactory::PrecacheManagerFactory()
26 : BrowserContextKeyedServiceFactory( 27 : BrowserContextKeyedServiceFactory(
27 "PrecacheManager", BrowserContextDependencyManager::GetInstance()) {} 28 "PrecacheManager",
29 BrowserContextDependencyManager::GetInstance()) {
30 }
28 31
29 PrecacheManagerFactory::~PrecacheManagerFactory() {} 32 PrecacheManagerFactory::~PrecacheManagerFactory() {
33 }
30 34
31 KeyedService* PrecacheManagerFactory::BuildServiceInstanceFor( 35 KeyedService* PrecacheManagerFactory::BuildServiceInstanceFor(
32 content::BrowserContext* browser_context) const { 36 content::BrowserContext* browser_context) const {
33 return new PrecacheManager(browser_context); 37 return new PrecacheManager(
38 browser_context,
39 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(
40 browser_context));
34 } 41 }
35 42
36 } // namespace precache 43 } // namespace precache
OLDNEW
« no previous file with comments | « chrome/browser/precache/precache_manager_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698