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

Unified Diff: components/favicon/core/fallback_icon_service.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: components/favicon/core/fallback_icon_service.h
diff --git a/components/favicon/core/fallback_icon_service.h b/components/favicon/core/fallback_icon_service.h
index 9b3f6ba10a028a1669daf0a14ea1a90c9d6a7937..a1b3e6fccbaa3ad3e03809225384e64109e0cb40 100644
--- a/components/favicon/core/fallback_icon_service.h
+++ b/components/favicon/core/fallback_icon_service.h
@@ -5,11 +5,12 @@
#ifndef COMPONENTS_FAVICON_CORE_FALLBACK_ICON_SERVICE_H_
#define COMPONENTS_FAVICON_CORE_FALLBACK_ICON_SERVICE_H_
-#include <string>
#include <vector>
#include "base/macros.h"
+#include "components/keyed_service/core/keyed_service.h"
+class FallbackIconClient;
class GURL;
namespace gfx {
@@ -21,10 +22,10 @@ struct FallbackIconStyle;
}
// A service to provide methods to render fallback favicons.
-class FallbackIconService {
+class FallbackIconService : public KeyedService {
public:
- explicit FallbackIconService(const std::vector<std::string>& font_list);
- ~FallbackIconService();
+ explicit FallbackIconService(FallbackIconClient* fallback_icon_client);
+ ~FallbackIconService() override;
// Renders a fallback icon synchronously and returns the bitmap. Returns an
// empty std::vector on failure. |size| is icon width and height in pixels.
@@ -41,7 +42,7 @@ class FallbackIconService {
const favicon_base::FallbackIconStyle& style,
gfx::Canvas* canvas);
- std::vector<std::string> font_list_;
+ FallbackIconClient* fallback_icon_client_;
DISALLOW_COPY_AND_ASSIGN(FallbackIconService);
};

Powered by Google App Engine
This is Rietveld 408576698