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

Unified Diff: chrome/browser/favicon/fallback_icon_service_factory.h

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: Removing FallbackIconSource::SendNotFoundResponse(). 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/fallback_icon_service_factory.h
diff --git a/chrome/browser/autocomplete/in_memory_url_index_factory.h b/chrome/browser/favicon/fallback_icon_service_factory.h
similarity index 40%
copy from chrome/browser/autocomplete/in_memory_url_index_factory.h
copy to chrome/browser/favicon/fallback_icon_service_factory.h
index 4f62a4a211d0cbe7901f94bd53d3d0db8ac7f0bc..30a3a7203b31bbb313136cda47c3d7cf6ae47d7e 100644
--- a/chrome/browser/autocomplete/in_memory_url_index_factory.h
+++ b/chrome/browser/favicon/fallback_icon_service_factory.h
@@ -2,33 +2,40 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_
-#define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_
+#ifndef CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_
+#define CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
template <typename T> struct DefaultSingletonTraits;
-class InMemoryURLIndex;
-class Profile;
+class FallbackIconService;
-class InMemoryURLIndexFactory : public BrowserContextKeyedServiceFactory {
+namespace content {
+class BrowserContext;
+}
+
+// Singleton that owns all FallbackIconService and associates them with
+// BrowserContext instances.
+class FallbackIconServiceFactory : public BrowserContextKeyedServiceFactory {
public:
- static InMemoryURLIndex* GetForProfile(Profile* profile);
- static InMemoryURLIndexFactory* GetInstance();
+ static FallbackIconService* GetForBrowserContext(
+ content::BrowserContext* context);
+
+ static FallbackIconServiceFactory* GetInstance();
private:
- friend struct DefaultSingletonTraits<InMemoryURLIndexFactory>;
+ friend struct DefaultSingletonTraits<FallbackIconServiceFactory>;
- InMemoryURLIndexFactory();
- ~InMemoryURLIndexFactory() override;
+ FallbackIconServiceFactory();
+ ~FallbackIconServiceFactory() override;
// BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
- content::BrowserContext* GetBrowserContextToUse(
- content::BrowserContext* context) const override;
bool ServiceIsNULLWhileTesting() const override;
+
+ DISALLOW_COPY_AND_ASSIGN(FallbackIconServiceFactory);
};
-#endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_FACTORY_H_
+#endif // CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_
« no previous file with comments | « chrome/browser/favicon/chrome_fallback_icon_client_factory.cc ('k') | chrome/browser/favicon/fallback_icon_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698