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

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

Issue 1705853002: NOT FOR REVIEW. ax tree focus with debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash Created 4 years, 10 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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 if (state & (1 << ui::AX_STATE_CHECKED)) 975 if (state & (1 << ui::AX_STATE_CHECKED))
976 msaa_state |= STATE_SYSTEM_CHECKED; 976 msaa_state |= STATE_SYSTEM_CHECKED;
977 if (state & (1 << ui::AX_STATE_COLLAPSED)) 977 if (state & (1 << ui::AX_STATE_COLLAPSED))
978 msaa_state |= STATE_SYSTEM_COLLAPSED; 978 msaa_state |= STATE_SYSTEM_COLLAPSED;
979 if (state & (1 << ui::AX_STATE_DEFAULT)) 979 if (state & (1 << ui::AX_STATE_DEFAULT))
980 msaa_state |= STATE_SYSTEM_DEFAULT; 980 msaa_state |= STATE_SYSTEM_DEFAULT;
981 if (state & (1 << ui::AX_STATE_EXPANDED)) 981 if (state & (1 << ui::AX_STATE_EXPANDED))
982 msaa_state |= STATE_SYSTEM_EXPANDED; 982 msaa_state |= STATE_SYSTEM_EXPANDED;
983 if (state & (1 << ui::AX_STATE_FOCUSABLE)) 983 if (state & (1 << ui::AX_STATE_FOCUSABLE))
984 msaa_state |= STATE_SYSTEM_FOCUSABLE; 984 msaa_state |= STATE_SYSTEM_FOCUSABLE;
985 if (state & (1 << ui::AX_STATE_FOCUSED))
986 msaa_state |= STATE_SYSTEM_FOCUSED;
987 if (state & (1 << ui::AX_STATE_HASPOPUP)) 985 if (state & (1 << ui::AX_STATE_HASPOPUP))
988 msaa_state |= STATE_SYSTEM_HASPOPUP; 986 msaa_state |= STATE_SYSTEM_HASPOPUP;
989 if (state & (1 << ui::AX_STATE_HOVERED)) 987 if (state & (1 << ui::AX_STATE_HOVERED))
990 msaa_state |= STATE_SYSTEM_HOTTRACKED; 988 msaa_state |= STATE_SYSTEM_HOTTRACKED;
991 if (state & (1 << ui::AX_STATE_INVISIBLE)) 989 if (state & (1 << ui::AX_STATE_INVISIBLE))
992 msaa_state |= STATE_SYSTEM_INVISIBLE; 990 msaa_state |= STATE_SYSTEM_INVISIBLE;
993 if (state & (1 << ui::AX_STATE_LINKED)) 991 if (state & (1 << ui::AX_STATE_LINKED))
994 msaa_state |= STATE_SYSTEM_LINKED; 992 msaa_state |= STATE_SYSTEM_LINKED;
995 if (state & (1 << ui::AX_STATE_OFFSCREEN)) 993 if (state & (1 << ui::AX_STATE_OFFSCREEN))
996 msaa_state |= STATE_SYSTEM_OFFSCREEN; 994 msaa_state |= STATE_SYSTEM_OFFSCREEN;
997 if (state & (1 << ui::AX_STATE_PRESSED)) 995 if (state & (1 << ui::AX_STATE_PRESSED))
998 msaa_state |= STATE_SYSTEM_PRESSED; 996 msaa_state |= STATE_SYSTEM_PRESSED;
999 if (state & (1 << ui::AX_STATE_PROTECTED)) 997 if (state & (1 << ui::AX_STATE_PROTECTED))
1000 msaa_state |= STATE_SYSTEM_PROTECTED; 998 msaa_state |= STATE_SYSTEM_PROTECTED;
1001 if (state & (1 << ui::AX_STATE_READ_ONLY)) 999 if (state & (1 << ui::AX_STATE_READ_ONLY))
1002 msaa_state |= STATE_SYSTEM_READONLY; 1000 msaa_state |= STATE_SYSTEM_READONLY;
1003 if (state & (1 << ui::AX_STATE_SELECTABLE)) 1001 if (state & (1 << ui::AX_STATE_SELECTABLE))
1004 msaa_state |= STATE_SYSTEM_SELECTABLE; 1002 msaa_state |= STATE_SYSTEM_SELECTABLE;
1005 if (state & (1 << ui::AX_STATE_SELECTED)) 1003 if (state & (1 << ui::AX_STATE_SELECTED))
1006 msaa_state |= STATE_SYSTEM_SELECTED; 1004 msaa_state |= STATE_SYSTEM_SELECTED;
1007 if (state & (1 << ui::AX_STATE_DISABLED)) 1005 if (state & (1 << ui::AX_STATE_DISABLED))
1008 msaa_state |= STATE_SYSTEM_UNAVAILABLE; 1006 msaa_state |= STATE_SYSTEM_UNAVAILABLE;
1009 1007
1008 gfx::NativeViewAccessible focus = delegate_->GetFocus();
1009 if (focus == GetNativeViewAccessible())
1010 msaa_state |= STATE_SYSTEM_FOCUSED;
1011
1012 // On Windows, the "focus" bit should be set on certain containers, like
1013 // menu bars, when one of their children has focus.
1014 if (GetData().role == ui::AX_ROLE_MENU_BAR && focus)
1015 msaa_state |= STATE_SYSTEM_FOCUSED;
1016
1010 return msaa_state; 1017 return msaa_state;
1011 } 1018 }
1012 1019
1013 int AXPlatformNodeWin::MSAAEvent(ui::AXEvent event) { 1020 int AXPlatformNodeWin::MSAAEvent(ui::AXEvent event) {
1014 switch (event) { 1021 switch (event) {
1015 case ui::AX_EVENT_ALERT: 1022 case ui::AX_EVENT_ALERT:
1016 return EVENT_SYSTEM_ALERT; 1023 return EVENT_SYSTEM_ALERT;
1017 case ui::AX_EVENT_FOCUS: 1024 case ui::AX_EVENT_FOCUS:
1018 return EVENT_OBJECT_FOCUS; 1025 return EVENT_OBJECT_FOCUS;
1019 case ui::AX_EVENT_MENU_START: 1026 case ui::AX_EVENT_MENU_START:
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 LONG start_offset, 1111 LONG start_offset,
1105 ui::TextBoundaryDirection direction) { 1112 ui::TextBoundaryDirection direction) {
1106 HandleSpecialTextOffset(text, &start_offset); 1113 HandleSpecialTextOffset(text, &start_offset);
1107 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 1114 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
1108 std::vector<int32_t> line_breaks; 1115 std::vector<int32_t> line_breaks;
1109 return static_cast<LONG>(ui::FindAccessibleTextBoundary( 1116 return static_cast<LONG>(ui::FindAccessibleTextBoundary(
1110 text, line_breaks, boundary, start_offset, direction)); 1117 text, line_breaks, boundary, start_offset, direction));
1111 } 1118 }
1112 1119
1113 } // namespace ui 1120 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_auralinux.cc ('k') | ui/app_list/views/search_result_actions_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698