diff options
author | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-16 01:44:35 +0000 |
---|---|---|
committer | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-16 01:44:35 +0000 |
commit | ded09895621502ed6e90fb2037af84b3e884bbf6 (patch) | |
tree | 72e3be508b024337b5cca329e712936ccaaebba9 /content/browser/plugin_process_host.cc | |
parent | e47151b7d5345d966ce96e03b9ad1d0009daf770 (diff) | |
download | chromium_src-ded09895621502ed6e90fb2037af84b3e884bbf6.zip chromium_src-ded09895621502ed6e90fb2037af84b3e884bbf6.tar.gz chromium_src-ded09895621502ed6e90fb2037af84b3e884bbf6.tar.bz2 |
Add scroll and gesture message filters for UIPI Flash.
Flash forwards some window messages when it has no handler set. The only ones I've observed are WM_MOUSEWHEEL, WM_APPCOMMAND (gestures are supported only on Win7). So, we need to allow these messages through the UIPI boundary.
One important note is that I use per-process message filters on Vista, but per-window filters on Win7 or later (because they're supported).
BUG=86810
TEST=None.
Review URL: http://codereview.chromium.org/7617019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96876 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/plugin_process_host.cc')
-rw-r--r-- | content/browser/plugin_process_host.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index 0d0f009..722f046 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -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 @@ void ReparentPluginWindowHelper(HWND window, HWND parent) { ::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::AddWindow(HWND window) { } 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; |