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

Unified Diff: chrome/browser/favicon/chrome_fallback_icon_client_factory.cc

Issue 996253002: [Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix; removing usage of Profile in factories. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
diff --git a/chrome/browser/ui/bookmarks/enhanced_bookmark_key_service_factory.cc b/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
similarity index 38%
copy from chrome/browser/ui/bookmarks/enhanced_bookmark_key_service_factory.cc
copy to chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
index ff2b8760e47c1e32513cc968e2fa1d2298d40a7a..6f92da938a182b5f60877420ec320a6d35240474 100644
--- a/chrome/browser/ui/bookmarks/enhanced_bookmark_key_service_factory.cc
+++ b/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc
@@ -2,44 +2,43 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/bookmarks/enhanced_bookmark_key_service_factory.h"
+#include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h"
#include "base/memory/singleton.h"
+#include "chrome/browser/favicon/chrome_fallback_icon_client.h"
#include "chrome/browser/profiles/incognito_helpers.h"
-#include "chrome/browser/ui/bookmarks/enhanced_bookmark_key_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "content/public/browser/browser_context.h"
-// static
-EnhancedBookmarkKeyServiceFactory*
- EnhancedBookmarkKeyServiceFactory::GetInstance() {
- return Singleton<EnhancedBookmarkKeyServiceFactory>::get();
-}
-
-EnhancedBookmarkKeyServiceFactory::EnhancedBookmarkKeyServiceFactory()
+ChromeFallbackIconClientFactory::ChromeFallbackIconClientFactory()
: BrowserContextKeyedServiceFactory(
- "EnhancedBookmarkKeyService",
+ "ChromeFallbackIconClient",
BrowserContextDependencyManager::GetInstance()) {
}
-EnhancedBookmarkKeyServiceFactory::~EnhancedBookmarkKeyServiceFactory() {
+ChromeFallbackIconClientFactory::~ChromeFallbackIconClientFactory() {
}
-KeyedService* EnhancedBookmarkKeyServiceFactory::BuildServiceInstanceFor(
- content::BrowserContext* context) const {
- return new EnhancedBookmarkKeyService(context);
+// static
+FallbackIconClient* ChromeFallbackIconClientFactory::GetForBrowserContext(
+ content::BrowserContext* context) {
+ return static_cast<FallbackIconClient*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
}
-content::BrowserContext*
- EnhancedBookmarkKeyServiceFactory::GetBrowserContextToUse(
- content::BrowserContext* context) const {
- return chrome::GetBrowserContextRedirectedInIncognito(context);
+// static
+ChromeFallbackIconClientFactory*
+ChromeFallbackIconClientFactory::GetInstance() {
+ return Singleton<ChromeFallbackIconClientFactory>::get();
}
-bool EnhancedBookmarkKeyServiceFactory::ServiceIsCreatedWithBrowserContext()
- const {
- return true;
+KeyedService* ChromeFallbackIconClientFactory::BuildServiceInstanceFor(
+ content::BrowserContext* /* context */) const {
+ return new ChromeFallbackIconClient();
}
-bool EnhancedBookmarkKeyServiceFactory::ServiceIsNULLWhileTesting() const {
- return true;
+content::BrowserContext*
+ChromeFallbackIconClientFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
pkotwicz 2015/03/27 18:52:31 Nit: Remove this method. The factories for Fallbac
huangs 2015/03/27 19:01:51 Done.
}

Powered by Google App Engine
This is Rietveld 408576698