diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-07 17:40:46 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-07 17:40:46 +0000 |
commit | 700d3d58213d15dea1beb2f7f7122e77e7ea2a47 (patch) | |
tree | 5d6a3c72fa58cccd7a7f7ddba5c77ed0edbe5135 /chrome/browser/plugin_process_host.cc | |
parent | d1ae85447a12e97b0758b0d113a12e2d6c6d09b4 (diff) | |
download | chromium_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/browser/plugin_process_host.cc')
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 55885bd..bfe5ea8 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -20,6 +20,7 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/file_version_info.h" +#include "base/gfx/native_widget_types.h" #include "base/logging.h" #include "base/path_service.h" #include "base/process_util.h" @@ -58,6 +59,10 @@ #include "chrome/common/ipc_channel_posix.h" #endif +#if defined(OS_LINUX) +#include "base/gfx/gtk_native_view_id_manager.h" +#endif + static const char kDefaultPluginFinderURL[] = "http://dl.google.com/chrome/plugins/plugins2.xml"; @@ -288,6 +293,14 @@ void PluginProcessHost::AddWindow(HWND window) { #endif // defined(OS_WIN) +#if defined(OS_LINUX) +void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id, + gfx::PluginWindowHandle* output) { + *output = 0; + Singleton<GtkNativeViewManager>()->GetXIDForId(output, id); +} +#endif // defined(OS_LINUX) + PluginProcessHost::PluginProcessHost() : ChildProcessHost( PLUGIN_PROCESS, @@ -438,6 +451,10 @@ void PluginProcessHost::OnMessageReceived(const IPC::Message& msg) { OnPluginWindowDestroyed) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_DownloadUrl, OnDownloadUrl) #endif +#if defined(OS_LINUX) + IPC_MESSAGE_HANDLER(PluginProcessHostMsg_MapNativeViewId, + OnMapNativeViewId) +#endif IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP() } |