OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/favicon/fallback_icon_service_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_factory.h" | 8 #include "chrome/browser/favicon/favicon_service_factory.h" |
9 #include "components/favicon/core/fallback_icon_service.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/favicon/core/favicon_service.h" |
| 11 #include "components/favicon/core/large_icon_service.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 #include "content/public/browser/browser_context.h" | 13 #include "content/public/browser/browser_context.h" |
12 | 14 |
13 // static | 15 // static |
14 favicon::FallbackIconService* FallbackIconServiceFactory::GetForBrowserContext( | 16 favicon::LargeIconService* LargeIconServiceFactory::GetForBrowserContext( |
15 content::BrowserContext* context) { | 17 content::BrowserContext* context) { |
16 return static_cast<favicon::FallbackIconService*>( | 18 return static_cast<favicon::LargeIconService*>( |
17 GetInstance()->GetServiceForBrowserContext(context, true)); | 19 GetInstance()->GetServiceForBrowserContext(context, true)); |
18 } | 20 } |
19 | 21 |
20 // static | 22 // static |
21 FallbackIconServiceFactory* FallbackIconServiceFactory::GetInstance() { | 23 LargeIconServiceFactory* LargeIconServiceFactory::GetInstance() { |
22 return Singleton<FallbackIconServiceFactory>::get(); | 24 return Singleton<LargeIconServiceFactory>::get(); |
23 } | 25 } |
24 | 26 |
25 FallbackIconServiceFactory::FallbackIconServiceFactory() | 27 LargeIconServiceFactory::LargeIconServiceFactory() |
26 : BrowserContextKeyedServiceFactory( | 28 : BrowserContextKeyedServiceFactory( |
27 "FallbackIconService", | 29 "LargeIconService", |
28 BrowserContextDependencyManager::GetInstance()) { | 30 BrowserContextDependencyManager::GetInstance()) { |
29 DependsOn(ChromeFallbackIconClientFactory::GetInstance()); | 31 DependsOn(FaviconServiceFactory::GetInstance()); |
30 } | 32 } |
31 | 33 |
32 FallbackIconServiceFactory::~FallbackIconServiceFactory() {} | 34 LargeIconServiceFactory::~LargeIconServiceFactory() {} |
33 | 35 |
34 KeyedService* FallbackIconServiceFactory::BuildServiceInstanceFor( | 36 KeyedService* LargeIconServiceFactory::BuildServiceInstanceFor( |
35 content::BrowserContext* context) const { | 37 content::BrowserContext* context) const { |
36 favicon::FallbackIconClient* fallback_icon_client = | 38 favicon::FaviconService* favicon_service = |
37 ChromeFallbackIconClientFactory::GetForBrowserContext(context); | 39 FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), |
38 return new favicon::FallbackIconService(fallback_icon_client); | 40 ServiceAccessType::EXPLICIT_ACCESS); |
| 41 return new favicon::LargeIconService(favicon_service); |
39 } | 42 } |
40 | 43 |
41 bool FallbackIconServiceFactory::ServiceIsNULLWhileTesting() const { | 44 bool LargeIconServiceFactory::ServiceIsNULLWhileTesting() const { |
42 return true; | 45 return true; |
43 } | 46 } |
OLD | NEW |