Index: webkit/tools/test_shell/webview_host.h |
diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h |
index 337a3553ea0324d4ab519ed65d3861ef4306298f..0cd62ee9e134eeaa46869439e4d85464c0bf23fc 100644 |
--- a/webkit/tools/test_shell/webview_host.h |
+++ b/webkit/tools/test_shell/webview_host.h |
@@ -5,6 +5,8 @@ |
#ifndef WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ |
#define WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ |
+#include <map> |
+ |
#include "base/basictypes.h" |
#include "base/gfx/native_widget_types.h" |
#include "base/gfx/rect.h" |
@@ -14,6 +16,10 @@ 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: |
@@ -26,12 +32,36 @@ class WebViewHost : public WebWidgetHost { |
WebView* webview() const; |
+#if defined(OS_LINUX) |
+ // Create a new plugin parent container, returning its X window id for |
+ // 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); |
+#endif |
+ |
protected: |
#if defined(OS_WIN) |
virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) { |
return false; |
} |
#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); |
+#endif |
}; |
#endif // WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ |