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

Unified Diff: webkit/tools/test_shell/webview_host.h

Issue 146009: linux plugins: eliminate GtkWidget* from plugin process (Closed)
Patch Set: retry Created 11 years, 6 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/test_webview_delegate_gtk.cc ('k') | webkit/tools/test_shell/webview_host_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate_gtk.cc ('k') | webkit/tools/test_shell/webview_host_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698