Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: webkit/tools/test_shell/webview_host_gtk.cc

Issue 146078: linux: OOP windowed plugins (Closed)
Patch Set: new version Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/webview_host.h ('k') | webkit/webkit.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/webview_host_gtk.cc
diff --git a/webkit/tools/test_shell/webview_host_gtk.cc b/webkit/tools/test_shell/webview_host_gtk.cc
index e089052df7bc1fc24121fe8e677cd24f5370d6f8..a2a76c6e3a5c0129343b7e45bbc5e83962dacb35 100644
--- a/webkit/tools/test_shell/webview_host_gtk.cc
+++ b/webkit/tools/test_shell/webview_host_gtk.cc
@@ -20,6 +20,7 @@ WebViewHost* WebViewHost::Create(GtkWidget* parent_view,
WebViewHost* host = new WebViewHost();
host->view_ = WebWidgetHost::CreateWidget(parent_view, host);
+ host->plugin_container_host_.set_host_widget(host->view_);
g_object_set_data(G_OBJECT(host->view_), "webwidgethost", host);
host->webwidget_ = WebView::Create(delegate, prefs);
@@ -33,41 +34,9 @@ WebView* WebViewHost::webview() const {
}
GdkNativeWindow WebViewHost::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;
+ return plugin_container_host_.CreatePluginContainer();
}
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);
+ plugin_container_host_.DestroyPluginContainer(id);
}
-
-gboolean WebViewHost::OnPlugRemoved(GtkSocket* socket) {
- return TRUE; // Don't destroy our widget; we manage it ourselves.
-}
-
« no previous file with comments | « webkit/tools/test_shell/webview_host.h ('k') | webkit/webkit.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698