Index: content/browser/plugin_process_host.cc |
=================================================================== |
--- content/browser/plugin_process_host.cc (revision 87939) |
+++ content/browser/plugin_process_host.cc (working copy) |
@@ -46,6 +46,8 @@ |
#endif |
#if defined(OS_WIN) |
+#include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
+ |
void PluginProcessHost::OnPluginWindowDestroyed(HWND window, HWND parent) { |
// The window is destroyed at this point, we just care about its parent, which |
// is the intermediate window we created. |
@@ -62,6 +64,21 @@ |
plugin_parent_windows_set_.insert(window); |
} |
+void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) { |
+ // Reparent only to our process. |
+ DWORD process_id = 0; |
+ ::GetWindowThreadProcessId(parent, &process_id); |
+ if (::IsWindow(window) && process_id != ::GetCurrentProcessId()) |
+ return; |
+ |
cpu_(ooo_6.6-7.5)
2011/06/07 01:03:36
If IsWindow() returns false you continue?
|
+ if (webkit::npapi::WebPluginDelegateImpl::IsDummyActivationWindow(window)) { |
+ ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD); |
+ } else { |
+ ::SetWindowLongPtr(window, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | |
+ WS_CLIPSIBLINGS); |
+ } |
+ ::SetParent(window, parent); |
+} |
#endif // defined(OS_WIN) |
#if defined(TOOLKIT_USES_GTK) |
@@ -245,6 +262,8 @@ |
#if defined(OS_WIN) |
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginWindowDestroyed, |
OnPluginWindowDestroyed) |
+ IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ReparentPluginWindow, |
+ OnReparentPluginWindow) |
#endif |
#if defined(TOOLKIT_USES_GTK) |
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_MapNativeViewId, |