OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <oleacc.h> | 8 #include <oleacc.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <wtsapi32.h> | 10 #include <wtsapi32.h> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "ui/views/views_delegate.h" | 38 #include "ui/views/views_delegate.h" |
39 #include "ui/views/widget/monitor_win.h" | 39 #include "ui/views/widget/monitor_win.h" |
40 #include "ui/views/widget/widget_hwnd_utils.h" | 40 #include "ui/views/widget/widget_hwnd_utils.h" |
41 #include "ui/views/win/fullscreen_handler.h" | 41 #include "ui/views/win/fullscreen_handler.h" |
42 #include "ui/views/win/hwnd_message_handler_delegate.h" | 42 #include "ui/views/win/hwnd_message_handler_delegate.h" |
43 #include "ui/views/win/scoped_fullscreen_visibility.h" | 43 #include "ui/views/win/scoped_fullscreen_visibility.h" |
44 | 44 |
45 namespace views { | 45 namespace views { |
46 namespace { | 46 namespace { |
47 | 47 |
| 48 // A version of the OBJID_CLIENT constant that works in 64-bit mode too. |
| 49 static const LPARAM kObjIdClient = static_cast<ULONG>(OBJID_CLIENT); |
| 50 |
48 // MoveLoopMouseWatcher is used to determine if the user canceled or completed a | 51 // MoveLoopMouseWatcher is used to determine if the user canceled or completed a |
49 // move. win32 doesn't appear to offer a way to determine the result of a move, | 52 // move. win32 doesn't appear to offer a way to determine the result of a move, |
50 // so we install hooks to determine if we got a mouse up and assume the move | 53 // so we install hooks to determine if we got a mouse up and assume the move |
51 // completed. | 54 // completed. |
52 class MoveLoopMouseWatcher { | 55 class MoveLoopMouseWatcher { |
53 public: | 56 public: |
54 MoveLoopMouseWatcher(HWNDMessageHandler* host, bool hide_on_escape); | 57 MoveLoopMouseWatcher(HWNDMessageHandler* host, bool hide_on_escape); |
55 ~MoveLoopMouseWatcher(); | 58 ~MoveLoopMouseWatcher(); |
56 | 59 |
57 // Returns true if the mouse is up, or if we couldn't install the hook. | 60 // Returns true if the mouse is up, or if we couldn't install the hook. |
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 } | 1413 } |
1411 SetMsgHandled(FALSE); | 1414 SetMsgHandled(FALSE); |
1412 } | 1415 } |
1413 | 1416 |
1414 LRESULT HWNDMessageHandler::OnGetObject(UINT message, | 1417 LRESULT HWNDMessageHandler::OnGetObject(UINT message, |
1415 WPARAM w_param, | 1418 WPARAM w_param, |
1416 LPARAM l_param) { | 1419 LPARAM l_param) { |
1417 LRESULT reference_result = static_cast<LRESULT>(0L); | 1420 LRESULT reference_result = static_cast<LRESULT>(0L); |
1418 | 1421 |
1419 // Accessibility readers will send an OBJID_CLIENT message | 1422 // Accessibility readers will send an OBJID_CLIENT message |
1420 if (OBJID_CLIENT == l_param) { | 1423 if (kObjIdClient == l_param) { |
1421 // Retrieve MSAA dispatch object for the root view. | 1424 // Retrieve MSAA dispatch object for the root view. |
1422 base::win::ScopedComPtr<IAccessible> root( | 1425 base::win::ScopedComPtr<IAccessible> root( |
1423 delegate_->GetNativeViewAccessible()); | 1426 delegate_->GetNativeViewAccessible()); |
1424 | 1427 |
1425 // Create a reference that MSAA will marshall to the client. | 1428 // Create a reference that MSAA will marshall to the client. |
1426 reference_result = LresultFromObject(IID_IAccessible, w_param, | 1429 reference_result = LresultFromObject(IID_IAccessible, w_param, |
1427 static_cast<IAccessible*>(root.Detach())); | 1430 static_cast<IAccessible*>(root.Detach())); |
1428 } | 1431 } |
1429 | 1432 |
1430 return reference_result; | 1433 return reference_result; |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 POINT cursor_pos = {0}; | 2423 POINT cursor_pos = {0}; |
2421 ::GetCursorPos(&cursor_pos); | 2424 ::GetCursorPos(&cursor_pos); |
2422 if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT))) | 2425 if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT))) |
2423 return false; | 2426 return false; |
2424 return true; | 2427 return true; |
2425 } | 2428 } |
2426 return false; | 2429 return false; |
2427 } | 2430 } |
2428 | 2431 |
2429 } // namespace views | 2432 } // namespace views |
OLD | NEW |