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

Unified Diff: chrome/browser/ui/webui/favicon_source.h

Issue 10909236: Add support for favicon scale factor in WebUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix HandleGetFaviconDominantColor. Created 8 years, 3 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/resources/shared/js/util.js ('k') | chrome/browser/ui/webui/favicon_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/favicon_source.h
diff --git a/chrome/browser/ui/webui/favicon_source.h b/chrome/browser/ui/webui/favicon_source.h
index b501c8bbd45a83da0baedee3380b08ec28d5e15a..564c00a039f1bebe8e0f542134792a6dae8a85cc 100644
--- a/chrome/browser/ui/webui/favicon_source.h
+++ b/chrome/browser/ui/webui/favicon_source.h
@@ -51,6 +51,23 @@ class FaviconSource : public ChromeURLDataManager::DataSource {
Profile* profile_;
private:
+
+ struct IconRequest {
+ IconRequest()
+ : request_id(0),
+ pixel_size(16),
+ scale_factor(ui::SCALE_FACTOR_NONE) {
+ }
+ IconRequest(int id, int size, ui::ScaleFactor scale)
+ : request_id(id),
+ pixel_size(size),
+ scale_factor(scale) {
+ }
+ int request_id;
+ int pixel_size;
+ ui::ScaleFactor scale_factor;
+ };
+
void Init(Profile* profile, IconType type);
// Called when favicon data is available from the history backend.
@@ -59,13 +76,9 @@ class FaviconSource : public ChromeURLDataManager::DataSource {
const history::FaviconBitmapResult& bitmap_result);
// Sends the default favicon.
- void SendDefaultResponse(int request_id);
-
- CancelableRequestConsumerT<int, 0> cancelable_consumer_;
+ void SendDefaultResponse(const IconRequest& request);
- // Map from request ID to size requested (in pixels). TODO(estade): Get rid of
- // this map when we properly support multiple favicon sizes.
- std::map<int, int> request_size_map_;
+ CancelableRequestConsumerTSimple<IconRequest> cancelable_consumer_;
// Raw PNG representation of the favicon to show when the favicon
// database doesn't have a favicon for a webpage.
« no previous file with comments | « chrome/browser/resources/shared/js/util.js ('k') | chrome/browser/ui/webui/favicon_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698