summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webplugin_delegate_proxy.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-06 20:32:41 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-06 20:32:41 +0000
commite4c0329c31debaec3b5fe8a1136321c143de7d97 (patch)
tree29609d0333ce7841305b942653085fb413e30b79 /chrome/renderer/webplugin_delegate_proxy.cc
parent1ee61486ee0854be7b82d9fca66bb49d563ede4c (diff)
downloadchromium_src-e4c0329c31debaec3b5fe8a1136321c143de7d97.zip
chromium_src-e4c0329c31debaec3b5fe8a1136321c143de7d97.tar.gz
chromium_src-e4c0329c31debaec3b5fe8a1136321c143de7d97.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 factor it, but I'm not sure where the common part should live. Review URL: http://codereview.chromium.org/146078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc29
1 files changed, 22 insertions, 7 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index b98b728..37012b8 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -331,6 +331,12 @@ void WebPluginDelegateProxy::InstallMissingPlugin() {
void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg)
IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow)
+#if defined(OS_LINUX)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_CreatePluginContainer,
+ OnCreatePluginContainer)
+ IPC_MESSAGE_HANDLER(PluginHostMsg_DestroyPluginContainer,
+ OnDestroyPluginContainer)
+#endif
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent,
OnSetWindowlessPumpEvent)
@@ -634,17 +640,26 @@ int WebPluginDelegateProxy::GetProcessId() {
return channel_host_->peer_pid();
}
-void WebPluginDelegateProxy::OnSetWindow(gfx::NativeViewId window_id) {
-#if defined(OS_WIN)
- gfx::NativeView window = gfx::NativeViewFromId(window_id);
- windowless_ = window == NULL;
+void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) {
+ windowless_ = window != static_cast<gfx::PluginWindowHandle>(0);
if (plugin_)
plugin_->SetWindow(window);
-#else
- NOTIMPLEMENTED();
-#endif
}
+#if defined(OS_LINUX)
+void WebPluginDelegateProxy::OnCreatePluginContainer(
+ gfx::PluginWindowHandle* container) {
+ RenderThread::current()->Send(new ViewHostMsg_CreatePluginContainer(
+ render_view_->routing_id(), container));
+}
+
+void WebPluginDelegateProxy::OnDestroyPluginContainer(
+ gfx::PluginWindowHandle container) {
+ RenderThread::current()->Send(new ViewHostMsg_DestroyPluginContainer(
+ render_view_->routing_id(), container));
+}
+#endif
+
#if defined(OS_WIN)
void WebPluginDelegateProxy::OnSetWindowlessPumpEvent(
HANDLE modal_loop_pump_messages_event) {