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

Unified Diff: content/browser/renderer_host/legacy_render_widget_host_win.cc

Issue 408313002: Merge 279172 "Proper fix for accessibility in Windows 64 build." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/legacy_render_widget_host_win.cc
===================================================================
--- content/browser/renderer_host/legacy_render_widget_host_win.cc (revision 284741)
+++ content/browser/renderer_host/legacy_render_widget_host_win.cc (working copy)
@@ -25,9 +25,6 @@
// 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());
}
@@ -138,14 +135,18 @@
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 obj_id = static_cast<DWORD>(static_cast<DWORD_PTR>(l_param));
+
+ 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(
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698