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

Unified Diff: chrome/browser/ui/webui/extensions/extension_icon_source.cc

Issue 10870022: Change FaviconData to be able to return data for multiple bitmaps for same icon URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/ui/webui/extensions/extension_icon_source.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_icon_source.cc b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
index b0901fa76ee708a68f79bd25f51b495bc6453b16..72f6a1ec83ad0a104f73270fb788d3b1d74b882c 100644
--- a/chrome/browser/ui/webui/extensions/extension_icon_source.cc
+++ b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
@@ -29,6 +29,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/color_utils.h"
+#include "ui/gfx/favicon_size.h"
#include "ui/gfx/skbitmap_operations.h"
#include "webkit/glue/image_decoder.h"
@@ -213,10 +214,12 @@ void ExtensionIconSource::LoadFaviconImage(int request_id) {
}
GURL favicon_url = GetData(request_id)->extension->GetFullLaunchURL();
- FaviconService::Handle handle = favicon_service->GetFaviconForURL(
+ FaviconService::Handle handle = favicon_service->GetRawFaviconForURL(
profile_,
favicon_url,
history::FAVICON,
+ gfx::kFaviconSize,
+ ui::SCALE_FACTOR_100P,
&cancelable_consumer_,
base::Bind(&ExtensionIconSource::OnFaviconDataAvailable,
base::Unretained(this)));
@@ -225,14 +228,14 @@ void ExtensionIconSource::LoadFaviconImage(int request_id) {
void ExtensionIconSource::OnFaviconDataAvailable(
FaviconService::Handle request_handle,
- history::FaviconData favicon) {
+ const history::FaviconBitmapResult& bitmap_result) {
int request_id = cancelable_consumer_.GetClientData(
FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS),
request_handle);
ExtensionIconRequest* request = GetData(request_id);
// Fallback to the default icon if there wasn't a favicon.
- if (!favicon.is_valid()) {
+ if (!bitmap_result.is_valid()) {
LoadDefaultImage(request_id);
return;
}
@@ -241,10 +244,10 @@ void ExtensionIconSource::OnFaviconDataAvailable(
// If we don't need a grayscale image, then we can bypass FinalizeImage
// to avoid unnecessary conversions.
ClearData(request_id);
- SendResponse(request_id, favicon.image_data);
+ SendResponse(request_id, bitmap_result.bitmap_data);
} else {
- FinalizeImage(ToBitmap(favicon.image_data->front(),
- favicon.image_data->size()), request_id);
+ FinalizeImage(ToBitmap(bitmap_result.bitmap_data->front(),
+ bitmap_result.bitmap_data->size()), request_id);
}
}

Powered by Google App Engine
This is Rietveld 408576698