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

Side by Side Diff: chrome/browser/favicon/large_icon_service_factory.cc

Issue 1092873002: [Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to f… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
huangs 2015/04/21 05:00:27 NOTE: The left file was unfortunately matched agai
beaudoin 2015/04/21 15:11:11 :( No idea what to do about this though...
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 "chrome/browser/favicon/chrome_fallback_icon_client_factory.h" 5 #include "chrome/browser/favicon/large_icon_service_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/favicon/chrome_fallback_icon_client.h" 8 #include "chrome/browser/favicon/favicon_service_factory.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "components/favicon/core/favicon_service.h"
10 #include "components/favicon/core/large_icon_service.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 #include "content/public/browser/browser_context.h" 12 #include "content/public/browser/browser_context.h"
12 13
13 ChromeFallbackIconClientFactory::ChromeFallbackIconClientFactory()
14 : BrowserContextKeyedServiceFactory(
15 "ChromeFallbackIconClient",
16 BrowserContextDependencyManager::GetInstance()) {
17 }
18
19 ChromeFallbackIconClientFactory::~ChromeFallbackIconClientFactory() {
20 }
21
22 // static 14 // static
23 favicon::FallbackIconClient* 15 favicon::LargeIconService* LargeIconServiceFactory::GetForBrowserContext(
24 ChromeFallbackIconClientFactory::GetForBrowserContext(
25 content::BrowserContext* context) { 16 content::BrowserContext* context) {
26 return static_cast<favicon::FallbackIconClient*>( 17 return static_cast<favicon::LargeIconService*>(
27 GetInstance()->GetServiceForBrowserContext(context, true)); 18 GetInstance()->GetServiceForBrowserContext(context, true));
28 } 19 }
29 20
30 // static 21 // static
31 ChromeFallbackIconClientFactory* 22 LargeIconServiceFactory* LargeIconServiceFactory::GetInstance() {
32 ChromeFallbackIconClientFactory::GetInstance() { 23 return Singleton<LargeIconServiceFactory>::get();
33 return Singleton<ChromeFallbackIconClientFactory>::get();
34 } 24 }
35 25
36 KeyedService* ChromeFallbackIconClientFactory::BuildServiceInstanceFor( 26 LargeIconServiceFactory::LargeIconServiceFactory()
27 : BrowserContextKeyedServiceFactory(
28 "LargeIconService",
29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(FaviconServiceFactory::GetInstance());
31 }
32
33 LargeIconServiceFactory::~LargeIconServiceFactory() {}
34
35 KeyedService* LargeIconServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* context) const { 36 content::BrowserContext* context) const {
38 return new ChromeFallbackIconClient(); 37 favicon::FaviconService* favicon_service =
38 FaviconServiceFactory::GetForBrowserContext(context);
39 return new favicon::LargeIconService(favicon_service);
39 } 40 }
41
42 bool LargeIconServiceFactory::ServiceIsNULLWhileTesting() const {
43 return true;
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698