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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 347743002: Proper fix for accessibility in Windows 64 build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two casts on one line Created 6 years, 6 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 | « ui/views/accessibility/native_view_accessibility_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index e4f55bfffd422f370514d8798259a5b763d98ecc..adbe4fabe69848e290f5e0961a2b867e1b9a4aef 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -45,9 +45,6 @@
namespace views {
namespace {
-// A version of the OBJID_CLIENT constant that works in 64-bit mode too.
-static const LPARAM kObjIdClient = static_cast<ULONG>(OBJID_CLIENT);
-
// MoveLoopMouseWatcher is used to determine if the user canceled or completed a
// move. win32 doesn't appear to offer a way to determine the result of a move,
// so we install hooks to determine if we got a mouse up and assume the move
@@ -1419,8 +1416,12 @@ LRESULT HWNDMessageHandler::OnGetObject(UINT message,
LPARAM l_param) {
LRESULT reference_result = static_cast<LRESULT>(0L);
+ // 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));
+
// Accessibility readers will send an OBJID_CLIENT message
- if (kObjIdClient == l_param) {
+ if (OBJID_CLIENT == obj_id) {
// Retrieve MSAA dispatch object for the root view.
base::win::ScopedComPtr<IAccessible> root(
delegate_->GetNativeViewAccessible());
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698