summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 23:59:51 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 23:59:51 +0000
commit86fd1a61b1715209da8482369d5667fcb1f0236f (patch)
treee61f323be8fd740fed3e992de387864fef4f5a6e /webkit/glue
parentd09f7b8c6658dce22559f9264cea1218f1d507c8 (diff)
downloadchromium_src-86fd1a61b1715209da8482369d5667fcb1f0236f.zip
chromium_src-86fd1a61b1715209da8482369d5667fcb1f0236f.tar.gz
chromium_src-86fd1a61b1715209da8482369d5667fcb1f0236f.tar.bz2
Add theming API to Pepper. For now, this only handles scrollbars.
Review URL: http://codereview.chromium.org/660158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/plugins/npapi_extension_thunk.cc32
-rw-r--r--webkit/glue/plugins/webplugin_2d_device_delegate.h9
2 files changed, 41 insertions, 0 deletions
diff --git a/webkit/glue/plugins/npapi_extension_thunk.cc b/webkit/glue/plugins/npapi_extension_thunk.cc
index ab5b852..1ffecfc 100644
--- a/webkit/glue/plugins/npapi_extension_thunk.cc
+++ b/webkit/glue/plugins/npapi_extension_thunk.cc
@@ -137,6 +137,29 @@ static NPError Device2DMapBuffer(NPP id,
return NPERR_GENERIC_ERROR;
}
+static NPError Device2DThemeGetSize(NPP id,
+ NPThemeItem item,
+ int* width,
+ int* height) {
+ scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
+ if (plugin) {
+ return plugin->webplugin()->delegate()->Device2DThemeGetSize(
+ item, width, height);
+ }
+ return NPERR_GENERIC_ERROR;
+}
+
+static NPError Device2DThemePaint(NPP id,
+ NPDeviceContext* context,
+ NPThemeParams* params) {
+ scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
+ if (plugin) {
+ return plugin->webplugin()->delegate()->Device2DThemePaint(
+ static_cast<NPDeviceContext2D*>(context), params);
+ }
+ return NPERR_GENERIC_ERROR;
+}
+
// 3D device API ---------------------------------------------------------------
static NPError Device3DQueryCapability(NPP id, int32 capability, int32* value) {
@@ -342,6 +365,8 @@ static NPDevice* AcquireDevice(NPP id, NPDeviceID device_id) {
Device2DCreateBuffer,
Device2DDestroyBuffer,
Device2DMapBuffer,
+ Device2DThemeGetSize,
+ Device2DThemePaint,
};
static NPDevice device_3d = {
Device3DQueryCapability,
@@ -354,6 +379,8 @@ static NPDevice* AcquireDevice(NPP id, NPDeviceID device_id) {
Device3DCreateBuffer,
Device3DDestroyBuffer,
Device3DMapBuffer,
+ NULL,
+ NULL,
};
static NPDevice device_audio = {
DeviceAudioQueryCapability,
@@ -363,6 +390,11 @@ static NPDevice* AcquireDevice(NPP id, NPDeviceID device_id) {
DeviceAudioGetStateContext,
DeviceAudioFlushContext,
DeviceAudioDestroyContext,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
};
switch (device_id) {
diff --git a/webkit/glue/plugins/webplugin_2d_device_delegate.h b/webkit/glue/plugins/webplugin_2d_device_delegate.h
index 69bd53a..b622d20 100644
--- a/webkit/glue/plugins/webplugin_2d_device_delegate.h
+++ b/webkit/glue/plugins/webplugin_2d_device_delegate.h
@@ -46,6 +46,15 @@ class WebPlugin2DDeviceDelegate {
virtual NPError Device2DDestroyContext(NPDeviceContext2D* context) {
return NPERR_GENERIC_ERROR;
}
+ virtual NPError Device2DThemeGetSize(NPThemeItem item,
+ int* width,
+ int* height) {
+ return NPERR_GENERIC_ERROR;
+ }
+ virtual NPError Device2DThemePaint(NPDeviceContext2D* context,
+ NPThemeParams* params) {
+ return NPERR_GENERIC_ERROR;
+ }
protected:
WebPlugin2DDeviceDelegate() {}