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

Side by Side Diff: components/arc/common/accessibility_helper.mojom

Issue 2640123004: Initial support for native accessibility in ARC (Closed)
Patch Set: override Created 3 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
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 // Next MinVersion: 1 5 // Next MinVersion: 2
6 6
7 module arc.mojom; 7 module arc.mojom;
8 8
9 import "screen_rect.mojom"; 9 import "screen_rect.mojom";
10 10
11 // AccessibilityEventType is a enum which corresponds to event types of 11 // For future maintainers, each of the below enums were hand picked
12 // AccessibilityEvent in Android. 12 // from their equivalents in the Android source. Keep them in the
13 // order given below and add as needed. The initial order matches the
14 // order they appear in source files.
15
16 // AccessibilityEventType lists the possible accessibility events on Android.
13 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityEvent.html 17 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityEvent.html
14 [Extensible] 18 [Extensible]
15 enum AccessibilityEventType { 19 enum AccessibilityEventType {
16 VIEW_FOCUSED, 20 VIEW_FOCUSED,
21 VIEW_SELECTED,
nasko 2017/02/15 19:49:40 The ordering doesn't seem to quite match the one i
David Tseng 2017/02/15 20:41:01 Good catch. Matches now except for VIEW_FOCUSED.
22 VIEW_CLICKED,
23 VIEW_LONG_CLICKED,
24 VIEW_TEXT_CHANGED,
25 WINDOW_STATE_CHANGED,
26 NOTIFICATION_STATE_CHANGED,
27 VIEW_HOVER_ENTER,
28 VIEW_HOVER_EXIT,
29 TOUCH_EXPLORATION_GESTURE_START,
30 TOUCH_EXPLORATION_GESTURE_END,
31 WINDOW_CONTENT_CHANGED,
32 VIEW_SCROLLED,
33 VIEW_TEXT_SELECTION_CHANGED,
34 ANNOUNCEMENT,
35 VIEW_ACCESSIBILITY_FOCUSED,
36 VIEW_ACCESSIBILITY_FOCUS_CLEARED,
37 VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
38 GESTURE_DETECTION_START,
39 GESTURE_DETECTION_END,
40 TOUCH_INTERACTION_START,
41 TOUCH_INTERACTION_END,
42 WINDOWS_CHANGED,
43 VIEW_CONTEXT_CLICKED,
44 ASSIST_READING_CONTEXT,
45 };
46
47 // AccessibilityActionType lists possible accessibility actions on Android.
48 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html
49 [Extensible]
50 enum AccessibilityActionType {
51 FOCUS,
52 CLEAR_FOCUS,
53 SELECT,
54 CLEAR_SELECTION,
55 CLICK,
56 LONG_CLICK,
57 ACCESSIBILITY_FOCUS,
58 CLEAR_ACCESSIBILITY_FOCUS,
59 NEXT_AT_MOVEMENT_GRANULARITY, // unused
60 PREVIOUS_AT_MOVEMENT_GRANULARITY, // unused
61 NEXT_HTML_ELEMENT, // unused
62 PREVIOUS_HTML_ELEMENT, // unused
63 SCROLL_FORWARD,
64 SCROLL_BACKWARD,
65 COPY,
66 PASTE,
67 CUT,
68 SET_SELECTION,
69 EXPAND,
70 COLLAPSE,
71 DISMISS,
72 SET_TEXT
73 };
74
75 // Possible boolean properties set on an AccessibilityNodeInfo.
76 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html
77 // The enum values appear in the same order as they do within
78 // AccessibilityNodeInfo.java.
79 [Extensible]
80 enum AccessibilityBooleanProperty {
81 CHECKABLE,
82 CHECKED,
83 FOCUSABLE,
84 FOCUSED,
85 SELECTED,
86 CLICKABLE,
87 LONG_CLICKABLE,
88 ENABLED,
89 PASSWORD,
90 SCROLLABLE,
91 ACCESSIBILITY_FOCUSED,
92 VISIBLE_TO_USER,
93 EDITABLE,
94 OPENS_POPUP,
95 DISMISSABLE,
96 MULTI_LINE,
97 CONTENT_INVALID,
98 CONTEXT_CLICKABLE,
99 IMPORTANCE
100 };
101
102 // These fields are taken from string instance members of
103 // AccessibilityNodeInfo.
104 enum AccessibilityStringProperty {
nasko 2017/02/15 19:49:40 Are these enums expected to not be extensible in t
David Tseng 2017/02/15 20:41:01 Made extensible.
105 PACKAGE_NAME,
106 CLASS_NAME,
107 TEXT,
108 CONTENT_DESCRIPTION,
109 VIEW_ID_RESOURCE_NAME
110 };
111
112 // These fields are taken from int instance members of
113 // AccessibilityNodeInfo.
114 enum AccessibilityIntProperty {
115 LABEL_FOR,
116 LABELED_BY,
117 TRAVERSAL_BEFORE,
118 TRAVERSAL_AFTER,
119 MAX_TEXT_LENGTH,
120 TEXT_SELECTION_START,
121 TEXT_SELECTION_END,
122 INPUT_TYPE,
123 LIVE_REGION
124 };
125
126 // These fields are taken from List<int> instance members of
127 // AccessibilityNodeInfo.
128 enum AccessibilityIntListProperty {
129 CHILD_NODE_IDS,
130 ACTIONS
17 }; 131 };
18 132
19 // AccessibilityNodeInfoData is a struct to contain info of 133 // AccessibilityNodeInfoData is a struct to contain info of
20 // AccessibilityNodeInfo in Android. 134 // AccessibilityNodeInfo in Android.
21 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html 135 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html
22 struct AccessibilityNodeInfoData { 136 struct AccessibilityNodeInfoData {
23 ScreenRect boundsInScreen; 137 ScreenRect boundsInScreen;
138 [MinVersion=1]int32 id;
139 [MinVersion=1]map<AccessibilityBooleanProperty, bool>? booleanProperties;
140 [MinVersion=1]map<AccessibilityStringProperty, string>? stringProperties;
141 [MinVersion=1]map<AccessibilityIntProperty, int32>? intProperties;
142 [MinVersion=1]map<AccessibilityIntListProperty, array<int32>>? intListProperti es;
24 }; 143 };
25 144
26 // Next method ID: 1 145 // Filters the event type (and implicitly the data) sent by the ARC accessibilit y service.
nasko 2017/02/15 19:49:40 Please keep comment lines to 80 characters.
146 [Extensible]
147 enum AccessibilityFilterType {
148 // No events will be sent.
149 OFF,
150
151 // Only send focus events along with the source focus node.
152 FOCUS,
153
154 // Send a complete tree from the event source's root for every event.
155 ALL
156 };
157
158 // AccessibilityEventData is a struct to contain info of
159 // AccessibilityEvent in Android.
160 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityEvent.html
161 struct AccessibilityEventData {
162 AccessibilityEventType eventType;
163 int32 sourceId;
164 array<AccessibilityNodeInfoData> nodeData;
165 };
166
167 // Next method ID: 2
27 interface AccessibilityHelperHost { 168 interface AccessibilityHelperHost {
169 OnAccessibilityEventDeprecated@0(AccessibilityEventType eventType,
170 AccessibilityNodeInfoData? eventSource);
nasko 2017/02/15 19:49:40 The parameters need to be aligned vertically.
David Tseng 2017/02/15 20:41:02 Done.
171
28 // OnAccessibilityEvent is called when a converted Android accessibility event 172 // OnAccessibilityEvent is called when a converted Android accessibility event
29 // is sent from Android. 173 // is sent from Android.
30 OnAccessibilityEvent@0(AccessibilityEventType eventType, 174 OnAccessibilityEvent@1(AccessibilityEventData eventData);
31 AccessibilityNodeInfoData? eventSource);
32 }; 175 };
33 176
34 // Next method ID: 1 177 // Next method ID: 3
35 interface AccessibilityHelperInstance { 178 interface AccessibilityHelperInstance {
36 Init@0(AccessibilityHelperHost host); 179 Init@0(AccessibilityHelperHost host);
180
181 // Perform the specified action on a node requested by a Chrome client.
182 PerformAction@1(int32 id, AccessibilityActionType action);
183
184 // Set a filter on the event types received.
185 SetFilter@2(AccessibilityFilterType filterType);
37 }; 186 };
OLDNEW
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698