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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_HOST_H_
6 #define WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_HOST_H_
7
8 #include <gtk/gtk.h>
9 #include <map>
10 #include "base/gfx/native_widget_types.h"
11
12 typedef struct _GtkWidget GtkWidget;
13 struct WebPluginGeometry;
14
15 // Helper class that creates and manages plugin containers (GtkSocket).
16 class GtkPluginContainerHost {
17 public:
18 GtkPluginContainerHost() : host_widget_(NULL) { }
19
20 // Sets the widget that will host the plugin containers. Must be a GtkFixed.
21 void set_host_widget(GtkWidget *widget) { host_widget_ = widget; }
22
23 // Creates a new plugin container, returning its XID.
24 gfx::PluginWindowHandle CreatePluginContainer();
25
26 // Destroys a plugin container, given its XID.
27 void DestroyPluginContainer(gfx::PluginWindowHandle container);
28
29 // Moves a plugin container.
30 void MovePluginContainer(const WebPluginGeometry& move);
31
32 private:
33 // Maps a plugin container XID to the corresponding widget.
34 GtkWidget* MapIDToWidget(gfx::PluginWindowHandle id);
35
36 // Call back for when the plugin container loses its XID, so that it can be
37 // removed from plugin_window_to_widget_map_.
38 static gboolean UnrealizeCallback(GtkWidget *widget, void *user_data);
39
40 // Parent of the plugin containers.
41 GtkWidget* host_widget_;
42
43 // A map that associates plugin containers to their XID.
44 typedef std::map<gfx::PluginWindowHandle, GtkWidget*> PluginWindowToWidgetMap;
45 PluginWindowToWidgetMap plugin_window_to_widget_map_;
46 };
47
48 #endif // WEBKIT_GLUE_PLUGINS_GTK_PLUGIN_CONTAINER_HOST_H_
OLDNEW
« 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