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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 2981083002: Migrate BrowserAccessibility windows unique id handling to AXPlatformNodeWin. (Closed)
Patch Set: Android fix. I was hoping I could get rid of this. Someday though! Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlcom.h> 6 #include <atlcom.h>
7 #include <limits.h> 7 #include <limits.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Menu items fire selection events but Windows screen readers work reliably 233 // Menu items fire selection events but Windows screen readers work reliably
234 // with focus events. Remap here. 234 // with focus events. Remap here.
235 if (event_type == ui::AX_EVENT_SELECTION && 235 if (event_type == ui::AX_EVENT_SELECTION &&
236 GetData().role == ui::AX_ROLE_MENU_ITEM) 236 GetData().role == ui::AX_ROLE_MENU_ITEM)
237 event_type = ui::AX_EVENT_FOCUS; 237 event_type = ui::AX_EVENT_FOCUS;
238 238
239 int native_event = MSAAEvent(event_type); 239 int native_event = MSAAEvent(event_type);
240 if (native_event < EVENT_MIN) 240 if (native_event < EVENT_MIN)
241 return; 241 return;
242 242
243 ::NotifyWinEvent(native_event, hwnd, OBJID_CLIENT, -unique_id_); 243 ::NotifyWinEvent(native_event, hwnd, OBJID_CLIENT, -unique_id());
244 244
245 // Keep track of objects that are a target of an alert event. 245 // Keep track of objects that are a target of an alert event.
246 if (event_type == ui::AX_EVENT_ALERT) 246 if (event_type == ui::AX_EVENT_ALERT)
247 AddAlertTarget(); 247 AddAlertTarget();
248 } 248 }
249 249
250 int AXPlatformNodeWin::GetIndexInParent() { 250 int AXPlatformNodeWin::GetIndexInParent() {
251 base::win::ScopedComPtr<IDispatch> parent_dispatch; 251 base::win::ScopedComPtr<IDispatch> parent_dispatch;
252 base::win::ScopedComPtr<IAccessible> parent_accessible; 252 base::win::ScopedComPtr<IAccessible> parent_accessible;
253 if (S_OK != get_accParent(parent_dispatch.GetAddressOf())) 253 if (S_OK != get_accParent(parent_dispatch.GetAddressOf()))
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 } 807 }
808 808
809 STDMETHODIMP AXPlatformNodeWin::get_states(AccessibleStates* states) { 809 STDMETHODIMP AXPlatformNodeWin::get_states(AccessibleStates* states) {
810 COM_OBJECT_VALIDATE_1_ARG(states); 810 COM_OBJECT_VALIDATE_1_ARG(states);
811 *states = IA2State(); 811 *states = IA2State();
812 return S_OK; 812 return S_OK;
813 } 813 }
814 814
815 STDMETHODIMP AXPlatformNodeWin::get_uniqueID(LONG* unique_id) { 815 STDMETHODIMP AXPlatformNodeWin::get_uniqueID(LONG* unique_id) {
816 COM_OBJECT_VALIDATE_1_ARG(unique_id); 816 COM_OBJECT_VALIDATE_1_ARG(unique_id);
817 *unique_id = -unique_id_; 817 *unique_id = -AXPlatformNode::unique_id();
818 return S_OK; 818 return S_OK;
819 } 819 }
820 820
821 STDMETHODIMP AXPlatformNodeWin::get_windowHandle(HWND* window_handle) { 821 STDMETHODIMP AXPlatformNodeWin::get_windowHandle(HWND* window_handle) {
822 COM_OBJECT_VALIDATE_1_ARG(window_handle); 822 COM_OBJECT_VALIDATE_1_ARG(window_handle);
823 *window_handle = delegate_->GetTargetForNativeAccessibilityEvent(); 823 *window_handle = delegate_->GetTargetForNativeAccessibilityEvent();
824 return *window_handle ? S_OK : S_FALSE; 824 return *window_handle ? S_OK : S_FALSE;
825 } 825 }
826 826
827 STDMETHODIMP AXPlatformNodeWin::get_relationTargetsOfType( 827 STDMETHODIMP AXPlatformNodeWin::get_relationTargetsOfType(
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
2760 if (container && container->GetData().role == ui::AX_ROLE_GROUP) 2760 if (container && container->GetData().role == ui::AX_ROLE_GROUP)
2761 container = FromNativeViewAccessible(container->GetParent()); 2761 container = FromNativeViewAccessible(container->GetParent());
2762 2762
2763 if (!container) 2763 if (!container)
2764 return false; 2764 return false;
2765 2765
2766 return container->GetData().role == ui::AX_ROLE_TREE_GRID; 2766 return container->GetData().role == ui::AX_ROLE_TREE_GRID;
2767 } 2767 }
2768 2768
2769 } // namespace ui 2769 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698