summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/app.gyp1
-rw-r--r--app/theme_provider.cc12
-rw-r--r--app/theme_provider.h18
3 files changed, 29 insertions, 2 deletions
diff --git a/app/app.gyp b/app/app.gyp
index e316d41d..faced76 100644
--- a/app/app.gyp
+++ b/app/app.gyp
@@ -101,6 +101,7 @@
'resource_bundle_mac.mm',
'slide_animation.cc',
'slide_animation.h',
+ 'theme_provider.cc',
'theme_provider.h',
'throb_animation.cc',
'throb_animation.h',
diff --git a/app/theme_provider.cc b/app/theme_provider.cc
new file mode 100644
index 0000000..7593e15
--- /dev/null
+++ b/app/theme_provider.cc
@@ -0,0 +1,12 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "app/theme_provider.h"
+
+// We have the destructor here because GCC puts the vtable in the first file
+// that includes a virtual function of the class. Leaving it just in the .h file
+// means that GCC will fail to link.
+
+ThemeProvider::~ThemeProvider() {
+}
diff --git a/app/theme_provider.h b/app/theme_provider.h
index 774810e..75e9255 100644
--- a/app/theme_provider.h
+++ b/app/theme_provider.h
@@ -10,7 +10,13 @@
#if defined(OS_LINUX)
#include <gdk/gdk.h>
-#endif
+#elif defined(OS_MACOSX)
+#ifdef __OBJC__
+@class NSImage;
+#else
+class NSImage;
+#endif // __OBJC__
+#endif // OS_*
class SkBitmap;
@@ -25,7 +31,7 @@ class SkBitmap;
class ThemeProvider {
public:
- virtual ~ThemeProvider() { }
+ virtual ~ThemeProvider();
// Get the bitmap specified by |id|. An implementation of ThemeProvider should
// have its own source of ids (e.g. an enum, or external resource bundle).
@@ -56,6 +62,14 @@ class ThemeProvider {
// pointer to a shared empty placeholder bitmap so it will be visible what
// is missing.
virtual GdkPixbuf* GetPixbufNamed(int id) = 0;
+#elif defined(OS_MACOSX)
+ // Gets the NSImage with the specified |id|. Returns a pointer to a shared
+ // instance of the NSImage. This shared NSImage is owned by the theme
+ // provider and should not be freed.
+ //
+ // The bitmap is not assumed to exist. If a theme does not provide an image,
+ // this function will return nil.
+ virtual NSImage* GetNSImageNamed(int id) = 0;
#endif
};