Index: chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
index cbc9a213e31aa0cd2abc4dabda00560a505c8c92..eb3ab9823a5e37228825f6eed1e3858874360a38 100644 |
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
@@ -847,33 +847,26 @@ void TabRendererGtk::PaintIcon(GtkWidget* widget, cairo_t* cr) { |
if (loading_animation_.animation_state() != ANIMATION_NONE) { |
PaintLoadingAnimation(widget, cr); |
Evan Stade
2011/10/28 20:34:25
return; instead of having rest of function in else
Elliot Glaysher
2011/10/28 20:48:42
Done.
|
} else { |
+ CairoCachedSurface* to_display = NULL; |
Evan Stade
2011/10/28 20:34:25
for your consideration:
CairoCachedSurface* to_di
|
if (should_display_crashed_favicon_) { |
- theme_service_->GetSurfaceNamed(IDR_SAD_FAVICON, widget)->SetSource( |
- cr, favicon_bounds_.x(), |
- favicon_bounds_.y() + favicon_hiding_offset_); |
- cairo_paint(cr); |
+ to_display = theme_service_->GetSurfaceNamed(IDR_SAD_FAVICON, widget); |
} else { |
Evan Stade
2011/10/28 20:34:25
this can be else if instead of else { if
Elliot Glaysher
2011/10/28 20:48:42
Done.
|
if (!data_.favicon.isNull()) { |
if (data_.is_default_favicon && theme_service_->UsingNativeTheme()) { |
- GdkPixbuf* favicon = GtkThemeService::GetDefaultFavicon(true); |
- |
- // TODO(erg): Get GtkThemeService to hand us a |
- // CairoCachedSurface. Then we can simplify all of this. |
- gdk_cairo_set_source_pixbuf( |
- cr, favicon, favicon_bounds_.x(), |
- favicon_bounds_.y() + favicon_hiding_offset_); |
- cairo_paint(cr); |
+ to_display = theme_service_->GetCairoIcon( |
+ GtkThemeService::NATIVE_FAVICON, widget); |
} else if (data_.cairo_favicon.valid()) { |
- // TODO(erg): We should research whether we still need to draw app |
- // icons larger. We don't appear to be getting larger icons. |
- data_.cairo_favicon.SetSource( |
- cr, |
- favicon_bounds_.x(), |
- favicon_bounds_.y() + favicon_hiding_offset_); |
- cairo_paint(cr); |
+ to_display = &data_.cairo_favicon; |
} |
} |
} |
+ |
+ if (to_display) { |
+ to_display->SetSource(cr, |
+ favicon_bounds_.x(), |
+ favicon_bounds_.y() + favicon_hiding_offset_); |
+ cairo_paint(cr); |
+ } |
} |
} |