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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_win.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: chrome/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 96590)
+++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -446,12 +446,33 @@
}
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 =
M-A Ruel 2011/08/12 23:50:05 Say No! to local static variables! In incurs a glo
+ 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,

Powered by Google App Engine
This is Rietveld 408576698