summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins/gtk_plugin_container.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 00:33:37 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 00:33:37 +0000
commit3b33faae96e4cf42ec6b0da5163668b1e482d821 (patch)
tree05bc5e540fdd3150cdc256d46b0602df0670c441 /webkit/glue/plugins/gtk_plugin_container.cc
parent5f1b0d6b9fb0b529202c63e99a67032cf1a306c9 (diff)
downloadchromium_src-3b33faae96e4cf42ec6b0da5163668b1e482d821.zip
chromium_src-3b33faae96e4cf42ec6b0da5163668b1e482d821.tar.gz
chromium_src-3b33faae96e4cf42ec6b0da5163668b1e482d821.tar.bz2
linux plugins: eliminate GtkWidget* from plugin process
GtkWidget* (and its wrapper, gfx::NativeView) only work within a single process. Plugins already work with a lower-level type that works across processes -- an X Window id. The parent of a plugin is an HWND on windows, but it's an X Window id on X. So we introduce a new typedef wrapping that and push it through all the places in the code that needs it. Since we no longer have a GtkSocket in the WebPluginDelegateImpl, we need to do a bit more work in the WebViewDelegate (aka the browser process in the multiproc world). We also need the plugin host (the browser) to track the GtkSockets that are hosting the plugin, as well as destroy them when necessary. To do this we require the plugin owner to grab the plug-removed signal rather than putting its handler in GtkPluginContainer; this is the way it worked before I'd refactored into GtkPluginContainer so it shouldn't be so bad. This change still only works in test_shell, but the refactoring should translate to the multiprocess case pretty easily. Review URL: http://codereview.chromium.org/146009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/gtk_plugin_container.cc')
-rw-r--r--webkit/glue/plugins/gtk_plugin_container.cc16
1 files changed, 1 insertions, 15 deletions
diff --git a/webkit/glue/plugins/gtk_plugin_container.cc b/webkit/glue/plugins/gtk_plugin_container.cc
index 18bdb30..c487fa0 100644
--- a/webkit/glue/plugins/gtk_plugin_container.cc
+++ b/webkit/glue/plugins/gtk_plugin_container.cc
@@ -14,13 +14,6 @@ namespace {
// through GLib's object management.
class GtkPluginContainer : public GtkSocket {
public:
- static GtkWidget* CreateNewWidget() {
- GtkWidget* container = GTK_WIDGET(g_object_new(GetType(), NULL));
- g_signal_connect(GTK_SOCKET(container), "plug-removed",
- G_CALLBACK(OnPlugRemoved), NULL);
- return container;
- }
-
// Sets the requested size of the widget.
void set_size(int width, int height) {
width_ = width;
@@ -33,7 +26,6 @@ class GtkPluginContainer : public GtkSocket {
return G_TYPE_CHECK_INSTANCE_CAST(instance, GetType(), GtkPluginContainer);
}
- private:
// Create and register our custom container type with GTK.
static GType GetType() {
static GType type = 0; // We only want to register our type once.
@@ -74,12 +66,6 @@ class GtkPluginContainer : public GtkSocket {
requisition->height = container->height_;
}
- static gboolean OnPlugRemoved(GtkSocket* socket) {
- // This is called when the other side of the socket goes away.
- // We return TRUE to indicate that we don't want to destroy our side.
- return TRUE;
- }
-
int width_;
int height_;
DISALLOW_IMPLICIT_CONSTRUCTORS(GtkPluginContainer);
@@ -89,7 +75,7 @@ class GtkPluginContainer : public GtkSocket {
// Create a new instance of our GTK widget object.
GtkWidget* gtk_plugin_container_new() {
- return GtkPluginContainer::CreateNewWidget();
+ return GTK_WIDGET(g_object_new(GtkPluginContainer::GetType(), NULL));
}
void gtk_plugin_container_set_size(GtkWidget *widget, int width, int height) {