Index: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm |
diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm |
index 9f4b2f4df97db48779b1fbb95a34d4b3ce317a94..2776b3a0158477de83282a6a162365c8f49e1809 100644 |
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm |
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm |
@@ -26,6 +26,8 @@ |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/web_contents.h" |
#include "skia/ext/skia_utils_mac.h" |
+#include "ui/gfx/image/image_skia.h" |
+#include "ui/gfx/image/image_skia_util_mac.h" |
using content::WebContents; |
using extensions::Extension; |
@@ -143,10 +145,13 @@ void PageActionDecoration::OnImageLoaded(const gfx::Image& image, |
// Map the index of the loaded image back to its name. If we ever get an |
// index greater than the number of icons, it must be the default icon. |
- if (index < static_cast<int>(page_action_->icon_paths()->size())) |
- page_action_->CacheIcon(page_action_->icon_paths()->at(index), image); |
- else |
- page_action_->CacheIcon(page_action_->default_icon_path(), image); |
+ if (index < static_cast<int>(page_action_->icon_paths()->size())) { |
+ page_action_->CacheIcon(page_action_->icon_paths()->at(index), |
+ *image.ToImageSkia()); |
+ } else { |
+ page_action_->CacheIcon(page_action_->default_icon_path(), |
+ *image.ToImageSkia()); |
+ } |
// If we have no owner, that means this class is still being constructed. |
TabContents* tab_contents = owner_ ? owner_->GetTabContents() : NULL; |
@@ -169,9 +174,9 @@ void PageActionDecoration::UpdateVisibility(WebContents* contents, |
SetToolTip(page_action_->GetTitle(current_tab_id_)); |
// Set the image. |
- gfx::Image icon = page_action_->GetIcon(current_tab_id_); |
- if (!icon.IsEmpty()) { |
- SetImage(icon.ToNSImage()); |
+ gfx::ImageSkia icon = page_action_->GetIcon(current_tab_id_); |
+ if (!icon.empty()) { |
+ SetImage(gfx::NSImageFromImageSkia(icon)); |
} else if (!GetImage()) { |
const NSSize default_size = NSMakeSize(Extension::kPageActionIconMaxSize, |
Extension::kPageActionIconMaxSize); |