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

Unified Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 10918186: Expire favicons which were added with default favicon sizes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | chrome/browser/favicon/favicon_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 1494de9c9241669e870240dfc81011baab56b47e..69b4745e0cebaf3ca5fa45f3d8d0e5b6edab832a 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -123,6 +123,7 @@ class ExtensionWebUIImageLoadingTracker : public ImageLoadingTracker::Observer {
// deleted.
void ForwardResult(const gfx::Image& icon) {
std::vector<history::FaviconBitmapResult> favicon_bitmap_results;
+ history::IconURLSizesMap icon_url_sizes;
SkBitmap icon_bitmap = icon.AsBitmap();
if (!icon_bitmap.empty()) {
scoped_refptr<base::RefCountedBytes> icon_data(
@@ -133,16 +134,22 @@ class ExtensionWebUIImageLoadingTracker : public ImageLoadingTracker::Observer {
bitmap_result.bitmap_data = icon_data;
bitmap_result.pixel_size = gfx::Size(icon_bitmap.width(),
icon_bitmap.height());
+ // Leave |bitmap_result|'s icon URL as the default of GURL().
bitmap_result.icon_type = history::FAVICON;
favicon_bitmap_results.push_back(bitmap_result);
+
+ // Build IconURLSizesMap such that the requirement that all the icon
+ // URLs in |favicon_bitmap_results| be present in |icon_url_sizes|
+ // holds. Set the favicon sizes to the pixel size of |icon_bitmap|.
+ icon_url_sizes[GURL()].push_back(bitmap_result.pixel_size);
} else {
NOTREACHED() << "Could not encode extension favicon";
}
}
request_->ForwardResultAsync(request_->handle(), favicon_bitmap_results,
- history::IconURLSizesMap());
+ icon_url_sizes);
delete this;
}
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698