diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 21:06:39 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 21:06:39 +0000 |
commit | da373225b0783166bca66c3534f7bde71eae0c51 (patch) | |
tree | bd744dbfae4f427cf4d9a42996e4ef07ea1da9c1 /webkit/tools/test_shell/webview_host_gtk.cc | |
parent | f98c1541c7c5671ed1de13ffc802d7e0bba276e9 (diff) | |
download | chromium_src-da373225b0783166bca66c3534f7bde71eae0c51.zip chromium_src-da373225b0783166bca66c3534f7bde71eae0c51.tar.gz chromium_src-da373225b0783166bca66c3534f7bde71eae0c51.tar.bz2 |
Revert "linux: OOP windowed plugins"
This reverts r19983. Test failures on Mac and Windows.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/webview_host_gtk.cc')
-rw-r--r-- | webkit/tools/test_shell/webview_host_gtk.cc | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/webview_host_gtk.cc b/webkit/tools/test_shell/webview_host_gtk.cc index 53c42d9..e089052 100644 --- a/webkit/tools/test_shell/webview_host_gtk.cc +++ b/webkit/tools/test_shell/webview_host_gtk.cc @@ -20,7 +20,6 @@ WebViewHost* WebViewHost::Create(GtkWidget* parent_view, WebViewHost* host = new WebViewHost(); host->view_ = WebWidgetHost::CreateWidget(parent_view, host); - host->plugin_container_manager_.set_host_widget(host->view_); g_object_set_data(G_OBJECT(host->view_), "webwidgethost", host); host->webwidget_ = WebView::Create(delegate, prefs); @@ -34,9 +33,41 @@ WebView* WebViewHost::webview() const { } GdkNativeWindow WebViewHost::CreatePluginContainer() { - return plugin_container_manager_.CreatePluginContainer(); + GtkWidget* plugin_container = gtk_plugin_container_new(); + g_signal_connect(G_OBJECT(plugin_container), "plug-removed", + G_CALLBACK(OnPlugRemovedThunk), this); + gtk_container_add(GTK_CONTAINER(view_handle()), plugin_container); + gtk_widget_show(plugin_container); + gtk_widget_realize(plugin_container); + + GdkNativeWindow id = gtk_socket_get_id(GTK_SOCKET(plugin_container)); + + native_window_to_widget_map_.insert(std::make_pair(id, plugin_container)); + + return id; +} + +GtkWidget* WebViewHost::MapIDToWidget(GdkNativeWindow id) { + NativeWindowToWidgetMap::const_iterator i = + native_window_to_widget_map_.find(id); + if (i != native_window_to_widget_map_.end()) + return i->second; + + LOG(ERROR) << "Request for widget host for unknown window id " << id; + + return NULL; } void WebViewHost::OnPluginWindowDestroyed(GdkNativeWindow id) { - plugin_container_manager_.DestroyPluginContainer(id); + GtkWidget* plugin_container = MapIDToWidget(id); + if (!plugin_container) + return; + + native_window_to_widget_map_.erase(id); + gtk_widget_destroy(plugin_container); } + +gboolean WebViewHost::OnPlugRemoved(GtkSocket* socket) { + return TRUE; // Don't destroy our widget; we manage it ourselves. +} + |