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

Unified Diff: chrome/browser/ui/intents/web_intent_picker_controller.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/intents/web_intent_picker_controller.cc
diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc
index f94c1467f5a1ac1141fea9855ca3d44886154191..6d0f4d7b2c5ae5aa7b0bba28ff934d5b18856930 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
@@ -497,10 +497,11 @@ void WebIntentPickerController::AddServiceToModel(
service.disposition);
pending_async_count_++;
- FaviconService::Handle handle = favicon_service->GetFaviconForURL(
+ FaviconService::Handle handle = favicon_service->GetFaviconImageForURL(
tab_contents_->profile(),
service.service_url,
history::FAVICON,
+ gfx::kFaviconSize,
&favicon_consumer_,
base::Bind(
&WebIntentPickerController::OnFaviconDataAvailable,
@@ -574,18 +575,12 @@ void WebIntentPickerController::RegistryCallsCompleted() {
}
void WebIntentPickerController::OnFaviconDataAvailable(
- FaviconService::Handle handle, history::FaviconData favicon_data) {
+ FaviconService::Handle handle,
+ const history::FaviconImageResult& image_result) {
size_t index = favicon_consumer_.GetClientDataForCurrentRequest();
- if (favicon_data.is_valid()) {
- SkBitmap icon_bitmap;
-
- if (gfx::PNGCodec::Decode(favicon_data.image_data->front(),
- favicon_data.image_data->size(),
- &icon_bitmap)) {
- gfx::Image icon_image(icon_bitmap);
- picker_model_->UpdateFaviconAt(index, icon_image);
- return;
- }
+ if (!image_result.image.IsEmpty()) {
+ picker_model_->UpdateFaviconAt(index, image_result.image);
+ return;
}
AsyncOperationFinished();

Powered by Google App Engine
This is Rietveld 408576698