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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk.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/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
index a270455f1618b99819db0d6f7701bbbd0c482856..c18547eb964070723728fa00c5b90079e1af7e67 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc
@@ -1793,9 +1793,9 @@ void LocationBarViewGtk::PageActionViewGtk::UpdateVisibility(
page_action_->GetTitle(current_tab_id_).c_str());
// Set the image.
- gfx::Image icon = page_action_->GetIcon(current_tab_id_);
- if (!icon.IsEmpty()) {
- GdkPixbuf* pixbuf = icon.ToGdkPixbuf();
+ gfx::ImageSkia icon = page_action_->GetIcon(current_tab_id_);
+ if (!icon.empty()) {
+ GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(*icon.bitmap());
DCHECK(pixbuf);
gtk_image_set_from_pixbuf(GTK_IMAGE(image_.get()), pixbuf);
}
@@ -1828,10 +1828,13 @@ void LocationBarViewGtk::PageActionViewGtk::OnImageLoaded(
// 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;

Powered by Google App Engine
This is Rietveld 408576698