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

Unified Diff: chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc

Issue 9535002: GTK: Update ImageLoadingTracker::Observer subclasses (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/infobars/extension_infobar_gtk.cc
diff --git a/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
index 4251b18ca31ee3854570a40f932dd5abe1cecd9e..3706ea191572f62d9bd947d2c1fab562cc681d83 100644
--- a/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
+++ b/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
@@ -63,17 +63,20 @@ void ExtensionInfoBarGtk::GetBottomColor(InfoBarDelegate::Type type,
*r = *g = *b = 218.0 / 255.0;
}
-void ExtensionInfoBarGtk::OnImageLoaded(
- SkBitmap* image, const ExtensionResource& resource, int index) {
+void ExtensionInfoBarGtk::OnImageLoaded(const gfx::Image& image,
+ const std::string& extension_id,
+ int index) {
if (!delegate_)
return; // The delegate can go away while we asynchronously load images.
// TODO(erg): IDR_EXTENSIONS_SECTION should have an IDR_INFOBAR_EXTENSIONS
// icon of the correct size with real subpixel shading and such.
- SkBitmap* icon = image;
+ const SkBitmap* icon = NULL;
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- if (!image || image->empty())
+ if (image.IsEmpty())
icon = rb.GetBitmapNamed(IDR_EXTENSIONS_SECTION);
+ else
+ icon = image.ToSkBitmap();
SkBitmap* drop_image = rb.GetBitmapNamed(IDR_APP_DROPARROW);
@@ -110,15 +113,11 @@ void ExtensionInfoBarGtk::BuildWidgets() {
const Extension* extension = delegate_->extension_host()->extension();
ExtensionResource icon_resource = extension->GetIconResource(
ExtensionIconSet::EXTENSION_ICON_BITTY, ExtensionIconSet::MATCH_EXACTLY);
- if (!icon_resource.relative_path().empty()) {
- // Create a tracker to load the image. It will report back on OnImageLoaded.
- tracker_.LoadImage(extension, icon_resource,
- gfx::Size(ExtensionIconSet::EXTENSION_ICON_BITTY,
- ExtensionIconSet::EXTENSION_ICON_BITTY),
- ImageLoadingTracker::DONT_CACHE);
- } else {
- OnImageLoaded(NULL, icon_resource, 0);
- }
+ // Create a tracker to load the image. It will report back on OnImageLoaded.
+ tracker_.LoadImage(extension, icon_resource,
+ gfx::Size(ExtensionIconSet::EXTENSION_ICON_BITTY,
+ ExtensionIconSet::EXTENSION_ICON_BITTY),
+ ImageLoadingTracker::DONT_CACHE);
// Pad the bottom of the infobar by one pixel for the border.
alignment_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
« no previous file with comments | « chrome/browser/ui/gtk/infobars/extension_infobar_gtk.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698