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

Unified Diff: chrome/browser/ui/webui/fallback_icon_source.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
« no previous file with comments | « chrome/browser/search/instant_service.cc ('k') | chrome/browser/ui/webui/fallback_icon_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/fallback_icon_source.h
diff --git a/chrome/browser/ui/webui/fallback_icon_source.h b/chrome/browser/ui/webui/fallback_icon_source.h
index acc1d6b8805628e6344951d5cfa9ff0b55a58af9..c21fd9b447cea719fa6226bfc73c43eb773c0032 100644
--- a/chrome/browser/ui/webui/fallback_icon_source.h
+++ b/chrome/browser/ui/webui/fallback_icon_source.h
@@ -5,10 +5,18 @@
#ifndef CHROME_BROWSER_UI_WEBUI_FALLBACK_ICON_SOURCE_H_
#define CHROME_BROWSER_UI_WEBUI_FALLBACK_ICON_SOURCE_H_
+#include <string>
+
#include "base/memory/scoped_ptr.h"
-#include "components/favicon/core/fallback_icon_service.h"
#include "content/public/browser/url_data_source.h"
+class FallbackIconService;
+class GURL;
+
+namespace favicon_base {
+struct FallbackIconStyle;
+}
+
// FallbackIconSource services explicit chrome:// requests for fallback icons.
//
// Format:
@@ -41,7 +49,8 @@
// 32 * 0.5 = 16, and the icon's background shape is a circle.
class FallbackIconSource : public content::URLDataSource {
public:
- FallbackIconSource();
+ // |fallback_icon_service| is owned by caller, and may be null.
+ explicit FallbackIconSource(FallbackIconService* fallback_icon_service);
~FallbackIconSource() override;
@@ -57,11 +66,17 @@ class FallbackIconSource : public content::URLDataSource {
bool ShouldServiceRequest(const net::URLRequest* request) const override;
private:
+ void SendFallbackIconHelper(
+ const GURL& url,
+ int size_in_pixels,
+ const favicon_base::FallbackIconStyle& style,
+ const content::URLDataSource::GotDataCallback& callback);
+
// Sends the default fallback icon.
void SendDefaultResponse(
const content::URLDataSource::GotDataCallback& callback);
- scoped_ptr<FallbackIconService> fallback_icon_service_;
+ FallbackIconService* fallback_icon_service_;
DISALLOW_COPY_AND_ASSIGN(FallbackIconSource);
};
« no previous file with comments | « chrome/browser/search/instant_service.cc ('k') | chrome/browser/ui/webui/fallback_icon_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698