Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: content/browser/plugin_process_host.cc

Issue 7617019: Add scroll and gesture message filters for UIPI Flash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/plugin_process_host.cc
===================================================================
--- content/browser/plugin_process_host.cc (revision 95591)
+++ content/browser/plugin_process_host.cc (working copy)
@@ -4,9 +4,7 @@
#include "content/browser/plugin_process_host.h"
-#if defined(OS_WIN)
-#include <windows.h>
-#elif defined(OS_POSIX)
+#if defined(OS_POSIX)
#include <utility> // for pair<>
#endif
@@ -44,6 +42,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 {
@@ -57,6 +57,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
@@ -78,8 +81,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;

Powered by Google App Engine
This is Rietveld 408576698