| Index: chrome/browser/ui/cocoa/history_menu_bridge.mm
|
| diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm
|
| index 7dd8218b2ccae2ce20b9e83e0e3c6c6b4c206d81..f54173070ce11cbc9c5dd63de2077cf5f601ba63 100644
|
| --- a/chrome/browser/ui/cocoa/history_menu_bridge.mm
|
| +++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm
|
| @@ -462,7 +462,7 @@ void HistoryMenuBridge::GetFaviconForHistoryItem(HistoryItem* item) {
|
| }
|
|
|
| void HistoryMenuBridge::GotFaviconData(FaviconService::Handle handle,
|
| - history::FaviconData favicon) {
|
| + history::FaviconData favicon_data) {
|
| // Since we're going to do Cocoa-y things, make sure this is the main thread.
|
| DCHECK([NSThread isMainThread]);
|
|
|
| @@ -476,14 +476,16 @@ void HistoryMenuBridge::GotFaviconData(FaviconService::Handle handle,
|
| // Convert the raw data to Skia and then to a NSImage.
|
| // TODO(rsesek): Is there an easier way to do this?
|
| SkBitmap icon;
|
| - if (favicon.is_valid() &&
|
| - gfx::PNGCodec::Decode(favicon.image_data->front(),
|
| - favicon.image_data->size(), &icon)) {
|
| - NSImage* image = gfx::SkBitmapToNSImage(icon);
|
| - if (image) {
|
| - // The conversion was successful.
|
| - item->icon.reset([image retain]);
|
| - [item->menu_item setImage:item->icon.get()];
|
| + if (favicon_data.is_valid()) {
|
| + const history::FaviconDataElement& element = favicon_data.elements[0];
|
| + if (gfx::PNGCodec::Decode(element.bitmap_data->front(),
|
| + element.bitmap_data->size(), &icon)) {
|
| + NSImage* image = gfx::SkBitmapToNSImage(icon);
|
| + if (image) {
|
| + // The conversion was successful.
|
| + item->icon.reset([image retain]);
|
| + [item->menu_item setImage:item->icon.get()];
|
| + }
|
| }
|
| }
|
| }
|
|
|