summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-12 19:12:44 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-12 19:12:44 +0000
commitc62b7a565fc8932a2b17c1544026003f3aa1f99b (patch)
tree59096abde416a5e907fd180adbcc22cce07571d8 /chrome/browser/renderer_host
parent8252963a12dc832a040be3877ff9bc4ff6acaa1d (diff)
downloadchromium_src-c62b7a565fc8932a2b17c1544026003f3aa1f99b.zip
chromium_src-c62b7a565fc8932a2b17c1544026003f3aa1f99b.tar.gz
chromium_src-c62b7a565fc8932a2b17c1544026003f3aa1f99b.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 and WM_GESTURE (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@96592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 986bbb9..568c8fd 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -446,12 +446,33 @@ HWND RenderWidgetHostViewWin::ReparentWindow(HWND window) {
}
DCHECK(window_class);
+ HWND orig_parent = ::GetParent(window);
HWND parent = CreateWindowEx(
WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR,
MAKEINTATOM(window_class), 0,
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
- 0, 0, 0, 0, ::GetParent(window), 0, GetModuleHandle(NULL), 0);
+ 0, 0, 0, 0, orig_parent, 0, GetModuleHandle(NULL), 0);
ui::CheckWindowCreated(parent);
+ // If UIPI is enabled we need to add message filters for parents with
+ // children that cross process boundaries.
+ if (::GetPropW(orig_parent, webkit::npapi::kNativeWindowClassFilterProp)) {
+ // Process-wide message filters required on Vista must be added to:
+ // chrome_content_client.cc ChromeContentClient::SandboxPlugin
+ typedef BOOL (WINAPI *ChangeWindowMessageFilterExFunction)(
+ HWND hwnd,
+ UINT message,
+ DWORD action,
+ PCHANGEFILTERSTRUCT change_filter_struct);
+ static ChangeWindowMessageFilterExFunction s_ChangeWindowMessageFilterEx =
+ reinterpret_cast<ChangeWindowMessageFilterExFunction>(
+ ::GetProcAddress(::GetModuleHandle(L"user32.dll"),
+ "ChangeWindowMessageFilterEx"));
+ // Process-wide message filters required on Vista must be added to:
+ // chrome_content_client.cc ChromeContentClient::SandboxPlugin
+ s_ChangeWindowMessageFilterEx(parent, WM_MOUSEWHEEL, MSGFLT_ALLOW, NULL);
+ s_ChangeWindowMessageFilterEx(parent, WM_GESTURE, MSGFLT_ALLOW, NULL);
+ ::SetPropW(orig_parent, webkit::npapi::kNativeWindowClassFilterProp, NULL);
+ }
::SetParent(window, parent);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,