| Index: chrome/browser/renderer_host/render_widget_host_view_win.cc
|
| ===================================================================
|
| --- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 96877)
|
| +++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy)
|
| @@ -2,6 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +// Need Win 7 headers for WM_GESTURE and ChangeWindowMessageFilterEx
|
| +// TODO(jschuh): See crbug.com/92941 for longterm fix.
|
| +#undef WINVER
|
| +#define WINVER _WIN32_WINNT_WIN7
|
| +#undef _WIN32_WINNT
|
| +#define _WIN32_WINNT _WIN32_WINNT_WIN7
|
| +#include <windows.h>
|
| +
|
| #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
|
|
|
| #include <algorithm>
|
| @@ -207,6 +215,14 @@
|
| return ::DefWindowProc(window, message, wparam, lparam);
|
| }
|
|
|
| +// Must be dynamically loaded to avoid startup failures on Win XP.
|
| +typedef BOOL (WINAPI *ChangeWindowMessageFilterExFunction)(
|
| + HWND hwnd,
|
| + UINT message,
|
| + DWORD action,
|
| + PCHANGEFILTERSTRUCT change_filter_struct);
|
| +ChangeWindowMessageFilterExFunction g_ChangeWindowMessageFilterEx;
|
| +
|
| } // namespace
|
|
|
| // RenderWidgetHostView --------------------------------------------------------
|
| @@ -440,12 +456,30 @@
|
| }
|
| 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
|
| + if (!g_ChangeWindowMessageFilterEx) {
|
| + g_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
|
| + g_ChangeWindowMessageFilterEx(parent, WM_MOUSEWHEEL, MSGFLT_ALLOW, NULL);
|
| + g_ChangeWindowMessageFilterEx(parent, WM_GESTURE, MSGFLT_ALLOW, NULL);
|
| + ::SetPropW(orig_parent, webkit::npapi::kNativeWindowClassFilterProp, NULL);
|
| + }
|
| ::SetParent(window, parent);
|
| BrowserThread::PostTask(
|
| BrowserThread::IO, FROM_HERE,
|
|
|