| Index: content/browser/plugin_process_host.cc
|
| ===================================================================
|
| --- content/browser/plugin_process_host.cc (revision 96873)
|
| +++ content/browser/plugin_process_host.cc (working copy)
|
| @@ -45,6 +45,8 @@
|
| #endif
|
|
|
| #if defined(OS_WIN)
|
| +#include "base/win/windows_version.h"
|
| +#include "webkit/plugins/npapi/plugin_constants_win.h"
|
| #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
|
|
|
| namespace {
|
| @@ -58,6 +60,9 @@
|
|
|
| ::SetWindowLongPtr(window, GWL_STYLE, window_style);
|
| ::SetParent(window, parent);
|
| + // Allow the Flash plugin to forward some messages back to Chrome.
|
| + if (base::win::GetVersion() >= base::win::VERSION_WIN7)
|
| + ::SetPropW(parent, webkit::npapi::kNativeWindowClassFilterProp, HANDLE(-1));
|
| }
|
|
|
| } // namespace
|
| @@ -79,8 +84,11 @@
|
| }
|
|
|
| void PluginProcessHost::OnReparentPluginWindow(HWND window, HWND parent) {
|
| - // Reparent only to our process.
|
| + // Reparent only from the plugin process to our process.
|
| DWORD process_id = 0;
|
| + ::GetWindowThreadProcessId(window, &process_id);
|
| + if (process_id != ::GetProcessId(GetChildProcessHandle()))
|
| + return;
|
| ::GetWindowThreadProcessId(parent, &process_id);
|
| if (process_id != ::GetCurrentProcessId())
|
| return;
|
|
|