diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 18:09:38 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 18:09:38 +0000 |
commit | 4b5ea27735e55571b5c745e5827fc1e217d97447 (patch) | |
tree | cda78aa3bf86fa440525126f8daf2404782450fc /webkit | |
parent | 18b0832d7e012df21a196777add97c67e4b72cd9 (diff) | |
download | chromium_src-4b5ea27735e55571b5c745e5827fc1e217d97447.zip chromium_src-4b5ea27735e55571b5c745e5827fc1e217d97447.tar.gz chromium_src-4b5ea27735e55571b5c745e5827fc1e217d97447.tar.bz2 |
Add new widget API to Pepper to replace the old theming API. The implementation is a copy of the WebKit code, I will figure out how to reuse it soon.
Review URL: http://codereview.chromium.org/2011004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/npapi_extension_thunk.cc | 38 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_2d_device_delegate.h | 9 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate.h | 1 |
3 files changed, 10 insertions, 38 deletions
diff --git a/webkit/glue/plugins/npapi_extension_thunk.cc b/webkit/glue/plugins/npapi_extension_thunk.cc index 100beef..9a84cf4 100644 --- a/webkit/glue/plugins/npapi_extension_thunk.cc +++ b/webkit/glue/plugins/npapi_extension_thunk.cc @@ -137,29 +137,6 @@ 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) { @@ -441,8 +418,6 @@ static NPDevice* AcquireDevice(NPP id, NPDeviceID device_id) { Device2DCreateBuffer, Device2DDestroyBuffer, Device2DMapBuffer, - Device2DThemeGetSize, - Device2DThemePaint, NULL, NULL, NULL, @@ -460,8 +435,6 @@ static NPDevice* AcquireDevice(NPP id, NPDeviceID device_id) { Device3DCreateBuffer, Device3DDestroyBuffer, Device3DMapBuffer, - NULL, - NULL, Device3DGetNumConfigs, Device3DGetConfigAttribs, Device3DCreateContext, @@ -484,8 +457,6 @@ static NPDevice* AcquireDevice(NPP id, NPDeviceID device_id) { NULL, NULL, NULL, - NULL, - NULL, }; switch (device_id) { @@ -536,6 +507,14 @@ static void SelectedFindResultChanged(NPP id, int index) { plugin->webplugin()->delegate()->SelectedFindResultChanged(index); } +static NPWidgetExtensions* GetWidgetExtensions(NPP id) { + scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); + if (!plugin) + return NULL; + + return plugin->webplugin()->delegate()->GetWidgetExtensions(); +} + namespace NPAPI { NPError GetPepperExtensionsFunctions(void* value) { @@ -545,6 +524,7 @@ NPError GetPepperExtensionsFunctions(void* value) { &NumberOfFindResultsChanged, &SelectedFindResultChanged, &ChooseFile, + &GetWidgetExtensions, }; // Return a pointer to the canonical function table. diff --git a/webkit/glue/plugins/webplugin_2d_device_delegate.h b/webkit/glue/plugins/webplugin_2d_device_delegate.h index b622d20..69bd53a 100644 --- a/webkit/glue/plugins/webplugin_2d_device_delegate.h +++ b/webkit/glue/plugins/webplugin_2d_device_delegate.h @@ -46,15 +46,6 @@ 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() {} diff --git a/webkit/glue/plugins/webplugin_delegate.h b/webkit/glue/plugins/webplugin_delegate.h index 6b15839..981ef0f 100644 --- a/webkit/glue/plugins/webplugin_delegate.h +++ b/webkit/glue/plugins/webplugin_delegate.h @@ -150,6 +150,7 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate, virtual void StopFind() {} virtual void NumberOfFindResultsChanged(int total, bool final_result) {} virtual void SelectedFindResultChanged(int index) {} + virtual NPWidgetExtensions* GetWidgetExtensions() { return NULL; } // Used for zooming of full page plugins. 0 means reset, while -1 means zoom // out and +1 means zoom in. |