summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 17:40:46 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 17:40:46 +0000
commit700d3d58213d15dea1beb2f7f7122e77e7ea2a47 (patch)
tree5d6a3c72fa58cccd7a7f7ddba5c77ed0edbe5135 /chrome/common
parentd1ae85447a12e97b0758b0d113a12e2d6c6d09b4 (diff)
downloadchromium_src-700d3d58213d15dea1beb2f7f7122e77e7ea2a47.zip
chromium_src-700d3d58213d15dea1beb2f7f7122e77e7ea2a47.tar.gz
chromium_src-700d3d58213d15dea1beb2f7f7122e77e7ea2a47.tar.bz2
linux: OOP windowed plugins
There are still a few issues, but that's a start. - only windowed plugins - we can't currently create the gtksocket in background tabs, because their gtkwidgets are not yet in the hierarchy, so they can't be realized (that's what gives the XID). - the plugin process talks to the browser process through the renderer process to create/destroy the gtksockets, because the plugin doesn't know which renderer it's talking to. We need a bit more plumbing to be able to have direct IPC. - some code is duplicated between chrome and test_shell. We should probably refactor it, but I'm not sure where the common part should live. Patch from Antoine Labour <piman@google.com>, with some touchups by me. Review URL: http://codereview.chromium.org/146078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/plugin_messages_internal.h22
-rw-r--r--chrome/common/render_messages_internal.h7
2 files changed, 28 insertions, 1 deletions
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 9eed897..dc853c2 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/gfx/native_widget_types.h"
#include "base/shared_memory.h"
#include "build/build_config.h"
#include "chrome/common/ipc_message_macros.h"
@@ -97,6 +98,16 @@ IPC_BEGIN_MESSAGES(PluginProcessHost)
HWND /* caller window */)
#endif
+#if defined(OS_LINUX)
+ // On Linux, the mapping between NativeViewId and X window ids
+ // is known only to the browser. This message lets the plugin process
+ // ask about a NativeViewId that was provided by the renderer.
+ // It will get 0 back if it's a bogus input.
+ IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_MapNativeViewId,
+ gfx::NativeViewId /* input: native view id */,
+ gfx::PluginWindowHandle /* output: X window id */)
+#endif
+
IPC_END_MESSAGES(PluginProcessHost)
@@ -219,7 +230,16 @@ IPC_BEGIN_MESSAGES(PluginHost)
// The window parameter is a handle to the window if the plugin is a windowed
// plugin. It is NULL for windowless plugins.
IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow,
- gfx::NativeViewId /* window */)
+ gfx::PluginWindowHandle /* window */)
+
+#if defined(OS_LINUX)
+ // Asks the renderer to create a plugin container (GtkSocket).
+ IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_CreatePluginContainer,
+ gfx::PluginWindowHandle /* container */)
+ // Asks the renderer to destroy a plugin container (GtkSocket).
+ IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_DestroyPluginContainer,
+ gfx::PluginWindowHandle /* container */)
+#endif
#if defined(OS_WIN)
// The modal_loop_pump_messages_event parameter is an event handle which is
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index d04c3a5..d6ff653 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -929,6 +929,13 @@ IPC_BEGIN_MESSAGES(ViewHost)
IPC::ChannelHandle /* handle to channel */,
FilePath /* plugin_path */)
+#if defined(OS_LINUX)
+ IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_CreatePluginContainer,
+ gfx::PluginWindowHandle /* container */)
+ IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer,
+ gfx::PluginWindowHandle /* container */)
+#endif
+
// Clipboard IPC messages
// This message is used when the object list does not contain a bitmap.