diff options
| author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 00:29:29 +0000 | 
|---|---|---|
| committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 00:29:29 +0000 | 
| commit | 27a6d4a2a6e75422c06a05df929fcac8c3f828f1 (patch) | |
| tree | 1e9b1b27c950c61d011afbb41b0d6f19a7856263 | |
| parent | 904c139269c9338dccb600084c33e84d99a9f4e5 (diff) | |
| download | chromium_src-27a6d4a2a6e75422c06a05df929fcac8c3f828f1.zip chromium_src-27a6d4a2a6e75422c06a05df929fcac8c3f828f1.tar.gz chromium_src-27a6d4a2a6e75422c06a05df929fcac8c3f828f1.tar.bz2 | |
GTK: Prune out GetPixbufNamed() and move callers to the cross platform GetImageNamed().
BUG=106060
TEST=none
Review URL: http://codereview.chromium.org/8937012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114322 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | chrome/browser/themes/theme_service.h | 2 | ||||
| -rw-r--r-- | chrome/browser/themes/theme_service_gtk.cc | 4 | ||||
| -rw-r--r-- | chrome/browser/ui/gtk/gtk_theme_service.cc | 12 | ||||
| -rw-r--r-- | chrome/browser/ui/gtk/gtk_theme_service.h | 2 | ||||
| -rw-r--r-- | chrome/browser/ui/gtk/location_bar_view_gtk.cc | 16 | ||||
| -rw-r--r-- | ui/base/theme_provider.h | 1 | 
6 files changed, 9 insertions, 28 deletions
| diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index e06b450..912d514 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h @@ -170,12 +170,10 @@ class ThemeService : public base::NonThreadSafe,    // overrides ui::ThemeProvider is http://crbug.com/105040 .    // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are    // shared instances owned by the theme provider and should not be freed. -  virtual GdkPixbuf* GetPixbufNamed(int id) const OVERRIDE;    virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const OVERRIDE;  #elif defined(TOOLKIT_USES_GTK)    // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are    // shared instances owned by the theme provider and should not be freed. -  virtual GdkPixbuf* GetPixbufNamed(int id) const;    virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const;  #endif diff --git a/chrome/browser/themes/theme_service_gtk.cc b/chrome/browser/themes/theme_service_gtk.cc index e9d33bc..2ccd7cf 100644 --- a/chrome/browser/themes/theme_service_gtk.cc +++ b/chrome/browser/themes/theme_service_gtk.cc @@ -11,10 +11,6 @@  #include "third_party/skia/include/core/SkBitmap.h"  #include "ui/gfx/gtk_util.h" -GdkPixbuf* ThemeService::GetPixbufNamed(int id) const { -  return GetPixbufImpl(id, false); -} -  GdkPixbuf* ThemeService::GetRTLEnabledPixbufNamed(int id) const {    return GetPixbufImpl(id, true);  } diff --git a/chrome/browser/ui/gtk/gtk_theme_service.cc b/chrome/browser/ui/gtk/gtk_theme_service.cc index 190d461..7e3bd61 100644 --- a/chrome/browser/ui/gtk/gtk_theme_service.cc +++ b/chrome/browser/ui/gtk/gtk_theme_service.cc @@ -1125,18 +1125,6 @@ gfx::CairoCachedSurface* GtkThemeService::GetSurfaceNamedImpl(    return surface;  } -// PixbufProvidingMethod that undoes the negative sign on |id|. -GdkPixbuf* GtkThemeService::GetRTLEnabledPixbufNamedWrapper(int id) const { -  return GetRTLEnabledPixbufNamed(-id); -} - -// PixbufProvidingMethod that just calls ResourceBundle. We want to minimize -// the calls to this method because it aquires an AutoLock and we don't want -// this to happen all the time. -GdkPixbuf* GtkThemeService::GetUnthemedNativePixbuf(int id) const { -  return ResourceBundle::GetSharedInstance().GetNativeImageNamed(id); -} -  // PixbufProvidingMethod that maps a GtkThemeService::CairoDefaultIcon to a  // GdkPixbuf.  GdkPixbuf* GtkThemeService::GetPixbufForIconId(int id) const { diff --git a/chrome/browser/ui/gtk/gtk_theme_service.h b/chrome/browser/ui/gtk/gtk_theme_service.h index 114d48b..55f9baa 100644 --- a/chrome/browser/ui/gtk/gtk_theme_service.h +++ b/chrome/browser/ui/gtk/gtk_theme_service.h @@ -250,8 +250,6 @@ class GtkThemeService : public ThemeService {    //    // Especially since GetUnthemedNativePixbuf always locks and    // GetRTLEnabledPixbufNamedWrapper locks in debug builds. -  GdkPixbuf* GetRTLEnabledPixbufNamedWrapper(int id) const; -  GdkPixbuf* GetUnthemedNativePixbuf(int id) const;    GdkPixbuf* GetPixbufForIconId(int id) const;    // Handles signal from GTK that our theme has been changed. diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index 18139c7..363d9bd 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -851,8 +851,9 @@ void LocationBarViewGtk::UpdateSiteTypeArea() {    }    int resource_id = location_entry_->GetIcon(); -  gtk_image_set_from_pixbuf(GTK_IMAGE(location_icon_image_), -                            theme_service_->GetPixbufNamed(resource_id)); +  gtk_image_set_from_pixbuf( +      GTK_IMAGE(location_icon_image_), +      theme_service_->GetImageNamed(resource_id)->ToGdkPixbuf());    if (toolbar_model_->GetSecurityLevel() == ToolbarModel::EV_SECURE) {      if (!gtk_util::IsActingAsRoundedWindow(site_type_event_box_)) { @@ -1148,9 +1149,10 @@ void LocationBarViewGtk::UpdateStarIcon() {    command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled);    if (star_enabled) {      gtk_widget_show_all(star_.get()); -    gtk_image_set_from_pixbuf(GTK_IMAGE(star_image_), -        theme_service_->GetPixbufNamed( -            starred_ ? IDR_STAR_LIT : IDR_STAR)); +    int id = starred_ ? IDR_STAR_LIT : IDR_STAR; +    gtk_image_set_from_pixbuf( +        GTK_IMAGE(star_image_), +        theme_service_->GetImageNamed(id)->ToGdkPixbuf());    } else {      gtk_widget_hide_all(star_.get());    } @@ -1286,8 +1288,8 @@ void LocationBarViewGtk::ContentSettingImageViewGtk::UpdateFromTabContents(    }    gtk_image_set_from_pixbuf(GTK_IMAGE(image_.get()), -      GtkThemeService::GetFrom(parent_->browser()->profile())->GetPixbufNamed( -          content_setting_image_model_->get_icon())); +      GtkThemeService::GetFrom(parent_->browser()->profile())->GetImageNamed( +          content_setting_image_model_->get_icon())->ToGdkPixbuf());    gtk_widget_set_tooltip_text(widget(),        content_setting_image_model_->get_tooltip().c_str()); diff --git a/ui/base/theme_provider.h b/ui/base/theme_provider.h index 1d76bdf..ded4d1a 100644 --- a/ui/base/theme_provider.h +++ b/ui/base/theme_provider.h @@ -109,7 +109,6 @@ class UI_EXPORT ThemeProvider {    // assert in debug mode if it does not. On failure, this will return a    // pointer to a shared empty placeholder bitmap so it will be visible what    // is missing. -  virtual GdkPixbuf* GetPixbufNamed(int id) const = 0;    // As above, but flips it in RTL locales.    virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) const = 0; | 
