diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 20:32:41 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 20:32:41 +0000 |
commit | e4c0329c31debaec3b5fe8a1136321c143de7d97 (patch) | |
tree | 29609d0333ce7841305b942653085fb413e30b79 /webkit/tools/test_shell/webview_host.h | |
parent | 1ee61486ee0854be7b82d9fca66bb49d563ede4c (diff) | |
download | chromium_src-e4c0329c31debaec3b5fe8a1136321c143de7d97.zip chromium_src-e4c0329c31debaec3b5fe8a1136321c143de7d97.tar.gz chromium_src-e4c0329c31debaec3b5fe8a1136321c143de7d97.tar.bz2 |
linux: OOP windowed plugins
There are still a few issues, but that's a start.
- only windowed plugins
- we can't currently create the gtksocket in background tabs, because their gtkwidgets are not yet in the hierarchy, so they can't be realized (that's what gives the XID).
- the plugin process talks to the browser process through the renderer process to create/destroy the gtksockets, because the plugin doesn't know which renderer it's talking to. We need a bit more plumbing to be able to have direct IPC.
- some code is duplicated between chrome and test_shell. We should probably factor it, but I'm not sure where the common part should live.
Review URL: http://codereview.chromium.org/146078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/webview_host.h')
-rw-r--r-- | webkit/tools/test_shell/webview_host.h | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index 9c7c489..962633b 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -11,15 +11,14 @@ #include "base/gfx/native_widget_types.h" #include "base/gfx/rect.h" #include "webkit/tools/test_shell/webwidget_host.h" +#if defined(OS_LINUX) +#include "webkit/glue/plugins/gtk_plugin_container_manager.h" +#endif struct WebPreferences; class WebView; class WebViewDelegate; -#if defined(OS_LINUX) -typedef struct _GtkSocket GtkSocket; -#endif - // This class is a simple NativeView-based host for a WebView class WebViewHost : public WebWidgetHost { public: @@ -37,13 +36,12 @@ class WebViewHost : public WebWidgetHost { // embedders to use. GdkNativeWindow CreatePluginContainer(); - // Map a GdkNativeWindow returned by CreatePluginContainer() back to - // 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); + + GtkPluginContainerManager* plugin_container_manager() { + return &plugin_container_manager_; + } #endif protected: @@ -54,16 +52,8 @@ class WebViewHost : public WebWidgetHost { #endif #if defined(OS_LINUX) - // A map used for MapIDToWidget() above. - typedef std::map<GdkNativeWindow, GtkWidget*> NativeWindowToWidgetMap; - NativeWindowToWidgetMap native_window_to_widget_map_; - - // Callback for when one of our plugins goes away. - static gboolean OnPlugRemovedThunk(GtkSocket* socket, - WebViewHost* web_view_host) { - return web_view_host->OnPlugRemoved(socket); - } - gboolean OnPlugRemoved(GtkSocket* socket); + // Helper class that creates and moves plugin containers. + GtkPluginContainerManager plugin_container_manager_; #endif }; |