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

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: Cleanup; moving defensive code into FallbackIconSource and LargeIconSource. 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/favicon/fallback_icon_service_factory.h b/chrome/browser/favicon/fallback_icon_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..f90046e76b4c707d5ba05da2d4fd244c4d8c10fd
--- /dev/null
+++ b/chrome/browser/favicon/fallback_icon_service_factory.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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"
+#include "components/keyed_service/core/service_access_type.h"
+
+template <typename T> struct DefaultSingletonTraits;
+
+class FallbackIconService;
+class Profile;
+
+// Singleton that owns all FallbackIconService and associates them with
+// Profiles.
+class FallbackIconServiceFactory : public BrowserContextKeyedServiceFactory {
+ public:
+ // |access| defines what the caller plans to do with the service. See
+ // the ServiceAccessType definition in profile.h.
+ static FallbackIconService* GetForProfile(
+ Profile* profile, ServiceAccessType sat);
+
+ static FallbackIconServiceFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<FallbackIconServiceFactory>;
+
+ FallbackIconServiceFactory();
+ ~FallbackIconServiceFactory() override;
+
+ // BrowserContextKeyedServiceFactory:
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* profile) const override;
+ bool ServiceIsNULLWhileTesting() const override;
+
+ DISALLOW_COPY_AND_ASSIGN(FallbackIconServiceFactory);
+};
+
+#endif // CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698