diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 20:21:13 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 20:21:13 +0000 |
commit | 8fcc39da6cd2a6ea148886e2d8333fc02bd62a21 (patch) | |
tree | 09dbcbaa42b748b54c923461a951d10df79327b6 /chrome/browser/browser_theme_provider.h | |
parent | 9f50a2f07eb717f613b7cada7e25bfa6e3c79de2 (diff) | |
download | chromium_src-8fcc39da6cd2a6ea148886e2d8333fc02bd62a21.zip chromium_src-8fcc39da6cd2a6ea148886e2d8333fc02bd62a21.tar.gz chromium_src-8fcc39da6cd2a6ea148886e2d8333fc02bd62a21.tar.bz2 |
Add GetPixbufNamed to ThemeProvider. GetPixbufNamed converts a loaded theme bitmap to a GdkPixbuf and caches the image so ThemeProvider users don't need to release them ala ResourceBundle::GetPixbufNamed.
Review URL: http://codereview.chromium.org/113626
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.h')
-rw-r--r-- | chrome/browser/browser_theme_provider.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h index b6a2e84..c4138db 100644 --- a/chrome/browser/browser_theme_provider.h +++ b/chrome/browser/browser_theme_provider.h @@ -11,10 +11,15 @@ #include "app/resource_bundle.h" #include "app/theme_provider.h" +#include "base/basictypes.h" #include "base/non_thread_safe.h" #include "base/ref_counted.h" #include "skia/ext/skia_utils.h" +#if defined(OS_LINUX) +#include <gdk/gdk.h> +#endif + class Extension; class Profile; class DictionaryValue; @@ -51,6 +56,9 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, // ThemeProvider implementation. virtual SkBitmap* GetBitmapNamed(int id); virtual SkColor GetColor(int id); +#if defined(OS_LINUX) + virtual GdkPixbuf* GetPixbufNamed(int id); +#endif // Set the current theme to the theme defined in |extension|. void SetTheme(Extension* extension); @@ -119,6 +127,10 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, // track of the pointers. typedef std::map<int, SkBitmap*> ImageCache; ImageCache image_cache_; +#if defined(OS_LINUX) + typedef std::map<int, GdkPixbuf*> GdkPixbufMap; + GdkPixbufMap gdk_pixbufs_; +#endif // List of generate images that aren't stored in ResourceBundles image cache // and need to be freed. |