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

Unified Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 10827191: Convert extension action icons code to use ImageSkia instead of SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits 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/views/location_bar/page_action_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
index 0d9f5f63a87210e46780680a018cdb86573dcc0d..04440c729f2fb3b906de747cfd8c40b787cfed8d 100644
--- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
@@ -208,9 +208,11 @@ void PageActionImageView::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);
+ page_action_->CacheIcon(page_action_->icon_paths()->at(index),
+ *image.ToImageSkia());
else
- page_action_->CacheIcon(page_action_->default_icon_path(), image);
+ page_action_->CacheIcon(page_action_->default_icon_path(),
+ *image.ToImageSkia());
// During object construction owner_ will be NULL.
TabContents* tab_contents = owner_ ? owner_->GetTabContents() : NULL;
@@ -269,10 +271,9 @@ void PageActionImageView::UpdateVisibility(WebContents* contents,
SetTooltipText(UTF8ToUTF16(tooltip_));
// Set the image.
- gfx::Image icon = page_action_->GetIcon(current_tab_id_);
- if (!icon.IsEmpty()) {
- SetImage(*icon.ToImageSkia());
- }
+ gfx::ImageSkia icon = page_action_->GetIcon(current_tab_id_);
+ if (!icon.empty())
+ SetImage(icon);
SetVisible(true);
}

Powered by Google App Engine
This is Rietveld 408576698