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

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

Issue 6651014: Applied the IconType. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: removed the callback6 Created 9 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: chrome/browser/ui/webui/extension_icon_source.cc
diff --git a/chrome/browser/ui/webui/extension_icon_source.cc b/chrome/browser/ui/webui/extension_icon_source.cc
index 321cd55a7abc01d99a8b5c68c04aa8beb5a28426..b62aa2e2c752daabca411b72de4e6a6367519b6d 100644
--- a/chrome/browser/ui/webui/extension_icon_source.cc
+++ b/chrome/browser/ui/webui/extension_icon_source.cc
@@ -200,23 +200,23 @@ void ExtensionIconSource::LoadFaviconImage(int request_id) {
GURL favicon_url = GetData(request_id)->extension->GetFullLaunchURL();
FaviconService::Handle handle = favicon_service->GetFaviconForURL(
- favicon_url, &cancelable_consumer_,
+ favicon_url,
+ history::FAV_ICON,
+ &cancelable_consumer_,
NewCallback(this, &ExtensionIconSource::OnFaviconDataAvailable));
cancelable_consumer_.SetClientData(favicon_service, handle, request_id);
}
void ExtensionIconSource::OnFaviconDataAvailable(
FaviconService::Handle request_handle,
- bool know_favicon,
- scoped_refptr<RefCountedMemory> data,
- bool expired,
- GURL icon_url) {
+ FaviconService::FaviconData favicon) {
int request_id = cancelable_consumer_.GetClientData(
profile_->GetFaviconService(Profile::EXPLICIT_ACCESS), request_handle);
ExtensionIconRequest* request = GetData(request_id);
// Fallback to the default icon if there wasn't a favicon.
- if (!know_favicon || !data.get() || !data->size()) {
+ if (!favicon.known_icon || !favicon.image_data.get() ||
+ !favicon.image_data->size()) {
sky 2011/03/10 17:54:44 This code is in nearly every callback. Create a me
michaelbai 2011/03/11 01:11:28 Done.
LoadDefaultImage(request_id);
return;
}
@@ -225,9 +225,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, data);
+ SendResponse(request_id, favicon.image_data);
} else {
- FinalizeImage(ToBitmap(data->front(), data->size()), request_id);
+ FinalizeImage(ToBitmap(favicon.image_data->front(),
+ favicon.image_data->size()), request_id);
}
}

Powered by Google App Engine
This is Rietveld 408576698