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

Unified Diff: webkit/glue/plugins/gtk_plugin_container_host.h

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 | « chrome/renderer/webplugin_delegate_proxy.cc ('k') | webkit/glue/plugins/gtk_plugin_container_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/gtk_plugin_container_host.h
diff --git a/webkit/glue/plugins/gtk_plugin_container_host.h b/webkit/glue/plugins/gtk_plugin_container_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3558c28e75d51d33e378a34c7857bcca5e320c8
--- /dev/null
+++ b/webkit/glue/plugins/gtk_plugin_container_host.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_HOST_H_
+#define WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_HOST_H_
+
+#include <gtk/gtk.h>
+#include <map>
+#include "base/gfx/native_widget_types.h"
+
+typedef struct _GtkWidget GtkWidget;
+struct WebPluginGeometry;
+
+// Helper class that creates and manages plugin containers (GtkSocket).
+class GtkPluginContainerHost {
+ public:
+ GtkPluginContainerHost() : host_widget_(NULL) { }
+
+ // Sets the widget that will host the plugin containers. Must be a GtkFixed.
+ void set_host_widget(GtkWidget *widget) { host_widget_ = widget; }
+
+ // Creates a new plugin container, returning its XID.
+ gfx::PluginWindowHandle CreatePluginContainer();
+
+ // Destroys a plugin container, given its XID.
+ void DestroyPluginContainer(gfx::PluginWindowHandle container);
+
+ // Moves a plugin container.
+ void MovePluginContainer(const WebPluginGeometry& move);
+
+ private:
+ // Maps a plugin container XID to the corresponding widget.
+ GtkWidget* MapIDToWidget(gfx::PluginWindowHandle id);
+
+ // Call back for when the plugin container loses its XID, so that it can be
+ // removed from plugin_window_to_widget_map_.
+ static gboolean UnrealizeCallback(GtkWidget *widget, void *user_data);
+
+ // Parent of the plugin containers.
+ GtkWidget* host_widget_;
+
+ // A map that associates plugin containers to their XID.
+ typedef std::map<gfx::PluginWindowHandle, GtkWidget*> PluginWindowToWidgetMap;
+ PluginWindowToWidgetMap plugin_window_to_widget_map_;
+};
+
+#endif // WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_HOST_H_
« no previous file with comments | « chrome/renderer/webplugin_delegate_proxy.cc ('k') | webkit/glue/plugins/gtk_plugin_container_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698