Chromium Code Reviews| 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); |
| } |
| } |