diff options
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate_gtk.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host.h | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host_gtk.cc | 13 |
4 files changed, 19 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 2c85b8c..1b5a99e 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -88,6 +88,9 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, const std::string& mime_type, const std::string& clsid, std::string* actual_mime_type); +#if defined(OS_LINUX) + virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle); +#endif virtual WebKit::WebMediaPlayer* CreateWebMediaPlayer( WebKit::WebMediaPlayerClient* client); virtual WebKit::WebWorker* CreateWebWorker(WebKit::WebWorkerClient* client); diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 74586e5..cd21c17 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -98,6 +98,10 @@ WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( return WebPluginDelegateImpl::Create(info.path, mtype, plugin_parent); } +void TestWebViewDelegate::WillDestroyPluginWindow(unsigned long id) { + shell_->webViewHost()->OnPluginWindowDestroyed(id); +} + void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { GtkWidget* dialog = gtk_message_dialog_new( shell_->mainWnd(), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index 0cd62ee..9c7c489 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -41,6 +41,9 @@ class WebViewHost : public WebWidgetHost { // the GtkWidget hosting it. Used when we get a message back from the // renderer indicating a plugin needs to move. GtkWidget* MapIDToWidget(GdkNativeWindow id); + + // Called when a plugin has been destroyed. Lets us clean up our side. + void OnPluginWindowDestroyed(GdkNativeWindow id); #endif protected: diff --git a/webkit/tools/test_shell/webview_host_gtk.cc b/webkit/tools/test_shell/webview_host_gtk.cc index cd491af..e089052 100644 --- a/webkit/tools/test_shell/webview_host_gtk.cc +++ b/webkit/tools/test_shell/webview_host_gtk.cc @@ -58,11 +58,16 @@ GtkWidget* WebViewHost::MapIDToWidget(GdkNativeWindow id) { return NULL; } -gboolean WebViewHost::OnPlugRemoved(GtkSocket* socket) { - // Remove the socket's id from our list of widgets. - GdkNativeWindow id = gtk_socket_get_id(socket); +void WebViewHost::OnPluginWindowDestroyed(GdkNativeWindow id) { + GtkWidget* plugin_container = MapIDToWidget(id); + if (!plugin_container) + return; + native_window_to_widget_map_.erase(id); + gtk_widget_destroy(plugin_container); +} - return FALSE; // Destroy our widget. +gboolean WebViewHost::OnPlugRemoved(GtkSocket* socket) { + return TRUE; // Don't destroy our widget; we manage it ourselves. } |