summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_theme_provider.h
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 18:34:10 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-22 18:34:10 +0000
commit1279d5f395182c6fa783da0d85216777d931af6b (patch)
tree65eac9c68a5896e0fb3b39bc62344d8a8fb6b03d /chrome/browser/browser_theme_provider.h
parent3e3f0eb47762a85110fb11b850df776b59073f8d (diff)
downloadchromium_src-1279d5f395182c6fa783da0d85216777d931af6b.zip
chromium_src-1279d5f395182c6fa783da0d85216777d931af6b.tar.gz
chromium_src-1279d5f395182c6fa783da0d85216777d931af6b.tar.bz2
Theme image support for the Mac.
BUG=none TEST=none Review URL: http://codereview.chromium.org/140007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.h')
-rw-r--r--chrome/browser/browser_theme_provider.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h
index 9883c67..b5817a2 100644
--- a/chrome/browser/browser_theme_provider.h
+++ b/chrome/browser/browser_theme_provider.h
@@ -16,10 +16,6 @@
#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;
@@ -74,8 +70,10 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>,
virtual bool GetDisplayProperty(int id, int* result);
virtual bool ShouldUseNativeFrame();
virtual bool HasCustomImage(int id);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
virtual GdkPixbuf* GetPixbufNamed(int id);
+#elif defined(OS_MACOSX)
+ virtual NSImage* GetNSImageNamed(int id);
#endif
// Set the current theme to the theme defined in |extension|.
@@ -98,6 +96,10 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>,
typedef std::map<const std::string, skia::HSL> TintMap;
typedef std::map<const std::string, int> DisplayPropertyMap;
+ // Reads the image data from the theme file into the specified vector. Returns
+ // true on success.
+ bool ReadThemeFileData(int id, std::vector<unsigned char>* raw_data);
+
// Loads a bitmap from the theme, which may be tinted or
// otherwise modified, or an application default.
SkBitmap* LoadThemeBitmap(int id);
@@ -158,13 +160,20 @@ class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>,
// Frees generated images and clears the image cache.
void FreeImages();
+ // Clears the platform-specific image cache. Do not call directly; it's called
+ // from FreeImages().
+ void FreePlatformImages();
+
// Cached images. We cache all retrieved and generated bitmaps and keep
// track of the pointers.
typedef std::map<int, SkBitmap*> ImageCache;
ImageCache image_cache_;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
typedef std::map<int, GdkPixbuf*> GdkPixbufMap;
GdkPixbufMap gdk_pixbufs_;
+#elif defined(OS_MACOSX)
+ typedef std::map<int, NSImage*> NSImageMap;
+ NSImageMap nsimage_cache_;
#endif
// List of generate images that aren't stored in ResourceBundles image cache