Chromium Code Reviews| Index: content/browser/renderer_host/legacy_render_widget_host_win.cc |
| diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc |
| index 78ebab55d14dc9480f35cb805e2515cbdbb2fdcd..57b9702df094d4a1d65a1f64dec5dcb3cd133415 100644 |
| --- a/content/browser/renderer_host/legacy_render_widget_host_win.cc |
| +++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc |
| @@ -24,9 +24,6 @@ namespace content { |
| // accessibility support. |
| const int kIdScreenReaderHoneyPot = 1; |
| -// A version of the OBJID_CLIENT constant that works in 64-bit mode too. |
| -static const LPARAM kObjIdClient = static_cast<ULONG>(OBJID_CLIENT); |
| - |
| LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() { |
| ::DestroyWindow(hwnd()); |
| } |
| @@ -136,14 +133,19 @@ LRESULT LegacyRenderWidgetHostHWND::OnEraseBkGnd(UINT message, |
| LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message, |
| WPARAM w_param, |
| LPARAM l_param) { |
| - if (kIdScreenReaderHoneyPot == l_param) { |
| + // Only the lower 32 bits of l_param are valid when checking the object id |
| + // because it sometimes gets sign-extended incorrectly (but not always). |
| + DWORD_PTR unsigned_l_param = static_cast<DWORD_PTR>(l_param); |
| + DWORD obj_id = static_cast<DWORD>(unsigned_l_param); |
|
jschuh
2014/06/19 09:15:19
I'd just stack the casts like this (we do the same
|
| + |
| + if (kIdScreenReaderHoneyPot == obj_id) { |
| // When an MSAA client has responded to our fake event on this id, |
| // enable screen reader support. |
| BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); |
| return static_cast<LRESULT>(0L); |
| } |
| - if (kObjIdClient != l_param || !manager_) |
| + if (OBJID_CLIENT != obj_id || !manager_) |
| return static_cast<LRESULT>(0L); |
| base::win::ScopedComPtr<IAccessible> root( |