Chromium Code Reviews| Index: chrome/browser/renderer_host/render_widget_host_view_win.cc |
| =================================================================== |
| --- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 95591) |
| +++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy) |
| @@ -446,12 +446,31 @@ |
| } |
| 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)) { |
| + typedef BOOL (WINAPI *ChangeWindowMessageFilterExFunction)( |
|
cpu_(ooo_6.6-7.5)
2011/08/12 18:13:05
no need to GetProcAddress I think.
jschuh
2011/08/12 19:00:48
Just tested on WinXP and we crash on a failed impo
|
| + 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, |