diff options
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_gtk.cc | 10 | ||||
-rw-r--r-- | webkit/glue/webplugin.h | 7 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 11 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.h | 5 | ||||
-rw-r--r-- | webkit/glue/webview_delegate.h | 4 |
5 files changed, 30 insertions, 7 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index c20fee0..9f9838b 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc @@ -263,12 +263,10 @@ bool WebPluginDelegateImpl::WindowedCreatePlugin() { return false; } - window_.window = reinterpret_cast<void*>(parent_); - // The remainder of the code expects windowed_handle_ to exist for - // windowed mode, despite not actually ever reaching through - // windowed_handle_. It is still used as a token to represent "this - // plugin" in messages to the browser. - windowed_handle_ = parent_; + // Xembed plugins need a window created for them browser-side. + // Do that now. + windowed_handle_ = plugin_->CreatePluginContainer(); + window_.window = reinterpret_cast<void*>(windowed_handle_); if (!window_.ws_info) window_.ws_info = new NPSetWindowCallbackStruct; diff --git a/webkit/glue/webplugin.h b/webkit/glue/webplugin.h index 2debf9a..07d2470 100644 --- a/webkit/glue/webplugin.h +++ b/webkit/glue/webplugin.h @@ -52,6 +52,13 @@ class WebPlugin { WebPlugin() { } virtual ~WebPlugin() { } +#if defined(OS_LINUX) + // Called by the plugin delegate to request a container for a new + // windowed plugin. This handle will later get destroyed with + // WillDestroyWindow. + virtual gfx::PluginWindowHandle CreatePluginContainer() = 0; +#endif + // Called by the plugin delegate to let the WebPlugin know if the plugin is // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 35ea7b2..e554255 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -388,6 +388,17 @@ WebPluginImpl::WebPluginImpl(WebCore::HTMLPlugInElement* element, WebPluginImpl::~WebPluginImpl() { } +#if defined(OS_LINUX) +gfx::PluginWindowHandle WebPluginImpl::CreatePluginContainer() { + WebCore::Frame* frame = element_->document()->frame(); + WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame); + WebViewImpl* webview = webframe->GetWebViewImpl(); + if (!webview->delegate()) + return 0; + return webview->delegate()->CreatePluginContainer(); +} +#endif + void WebPluginImpl::SetWindow(gfx::PluginWindowHandle window) { if (window) { DCHECK(!windowless_); // Make sure not called twice. diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h index 7d51f39..b81e8a9 100644 --- a/webkit/glue/webplugin_impl.h +++ b/webkit/glue/webplugin_impl.h @@ -113,7 +113,7 @@ class WebPluginContainer : public WebCore::Widget { }; // This is the WebKit side of the plugin implementation that forwards calls, -// after changing out of WebCore types, to a delegate. The delegate will +// after changing out of WebCore types, to a delegate. The delegate may // be in a different process. class WebPluginImpl : public WebPlugin, public WebKit::WebURLLoaderClient { @@ -148,6 +148,9 @@ class WebPluginImpl : public WebPlugin, int arg_count, char** arg_names, char** arg_values); // WebPlugin implementation: +#if defined(OS_LINUX) + gfx::PluginWindowHandle CreatePluginContainer(); +#endif void SetWindow(gfx::PluginWindowHandle window); void WillDestroyWindow(gfx::PluginWindowHandle window); #if defined(OS_WIN) diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 7fe792f..6106d1d 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -133,6 +133,10 @@ class WebViewDelegate : virtual public WebWidgetDelegate { return NULL; } + // Called when a windowed plugin is initializing, to request a container + // for the plugin. Only used on Linux. + virtual gfx::PluginWindowHandle CreatePluginContainer() { return 0; } + // Called when a windowed plugin is closing. // Lets the view delegate shut down anything it is using to wrap the plugin. virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle) { } |