diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp index 679de6f..a548fd6 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp @@ -35,6 +35,12 @@ #include <WebCore/SharedBuffer.h> #include <utility> +#if PLATFORM(QT) +#include <QX11Info> +#elif PLATFORM(GTK) +#include <gdk/gdkx.h> +#endif + using namespace WebCore; using namespace std; @@ -484,17 +490,33 @@ static NPError NPN_GetValue(NPP npp, NPNVariable variable, void *value) *(NPBool*)value = true; break; #elif PLUGIN_ARCHITECTURE(X11) + case NPNVxDisplay: +#if PLATFORM(QT) + *reinterpret_cast<Display**>(value) = QX11Info::display(); + break; +#elif PLATFORM(GTK) + *reinterpret_cast<Display**>(value) = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); + break; +#else + goto default; +#endif + case NPNVSupportsXEmbedBool: + *static_cast<NPBool*>(value) = true; + break; + case NPNVSupportsWindowless: + *static_cast<NPBool*>(value) = true; + break; + case NPNVToolkit: { const uint32_t expectedGTKToolKitVersion = 2; RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); - if (plugin->quirks().contains(PluginQuirks::RequiresGTKToolKit)) { - *reinterpret_cast<uint32_t*>(value) = expectedGTKToolKitVersion; - break; - } - - return NPERR_GENERIC_ERROR; + *reinterpret_cast<uint32_t*>(value) = plugin->quirks().contains(PluginQuirks::RequiresGTKToolKit) ? + expectedGTKToolKitVersion : 0; + break; } + + // TODO: implement NPNVnetscapeWindow once we want to support windowed plugins. #endif default: notImplemented(); @@ -529,7 +551,12 @@ static NPError NPN_SetValue(NPP npp, NPPVariable variable, void *value) return NPERR_NO_ERROR; } - case NPPVpluginTransparentBool: + case NPPVpluginTransparentBool: { + RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); + plugin->setIsTransparent(value); + return NPERR_NO_ERROR; + } + default: notImplemented(); return NPERR_GENERIC_ERROR; |