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

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

Issue 2640123004: Initial support for native accessibility in ARC (Closed)
Patch Set: |window| can be nullptr 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
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: 1
yawano 2017/02/09 10:55:30 Update this to 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 // AccessibilityEventType lists the possible accessibility events on Android.
12 // AccessibilityEvent in Android.
13 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityEvent.html 12 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityEvent.html
14 [Extensible] 13 [Extensible]
15 enum AccessibilityEventType { 14 enum AccessibilityEventType {
16 VIEW_FOCUSED, 15 VIEW_FOCUSED,
16 VIEW_SELECTED,
17 VIEW_CLICKED,
18 VIEW_LONG_CLICKED,
19 VIEW_TEXT_CHANGED,
20 WINDOW_STATE_CHANGED,
dmazzoni 2017/02/09 01:18:09 Are these supposed to match the order of Android e
21 NOTIFICATION_STATE_CHANGED,
22 VIEW_HOVER_ENTER,
23 VIEW_HOVER_EXIT,
24 TOUCH_EXPLORATION_GESTURE_START,
25 TOUCH_EXPLORATION_GESTURE_END,
26 WINDOW_CONTENT_CHANGED,
27 VIEW_SCROLLED,
28 VIEW_TEXT_SELECTION_CHANGED,
29 ANNOUNCEMENT,
30 VIEW_ACCESSIBILITY_FOCUSED,
31 VIEW_ACCESSIBILITY_FOCUS_CLEARED,
32 VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
33 GESTURE_DETECTION_START,
34 GESTURE_DETECTION_END,
35 TOUCH_INTERACTION_START,
36 TOUCH_INTERACTION_END,
37 WINDOWS_CHANGED,
38 VIEW_CONTEXT_CLICKED,
39 ASSIST_READING_CONTEXT,
40 };
41
42 // AccessibilityActionType lists possible accessibility actions on Android.
43 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html
44 // Please note the omission of
dmazzoni 2017/02/09 01:18:09 Might be simpler to just map all of them even if s
45 // NEXT_AT_MOVEMENT_GRANULARITY,
46 // PREVIOUS_AT_MOVEMENT_GRANULARITY,
47 // NEXT_HTML_ELEMENT,
48 // PREVIOUS_HTML_ELEMENT
49 // Also note the omission of argument type mappings e.g. for setting selection.
50 [Extensible]
51 enum AccessibilityActionType {
52 FOCUS,
53 CLEAR_FOCUS,
54 SELECT,
55 CLEAR_SELECTION,
56 CLICK,
57 LONG_CLICK,
58 ACCESSIBILITY_FOCUS,
59 CLEAR_ACCESSIBILITY_FOCUS,
60 SCROLL_FORWARD,
61 SCROLL_BACKWARD,
62 COPY,
dmazzoni 2017/02/09 01:18:09 nit: some of these need indentation. Also, please
63 PASTE,
64 CUT,
65 SET_SELECTION,
66 EXPAND,
67 COLLAPSE,
68 DISMISS,
69 SET_TEXT
70 };
71
72 // Possible boolean properties set on an AccessibilityNodeInfo.
73 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html
74 [Extensible]
75 enum AccessibilityBooleanProperty {
76 CHECKABLE,
dmazzoni 2017/02/09 01:18:09 sort
77 CHECKED,
78 FOCUSABLE,
79 FOCUSED,
80 SELECTED,
81 CLICKABLE,
82 LONG_CLICKABLE,
83 ENABLED,
84 PASSWORD,
85 SCROLLABLE,
86 ACCESSIBILITY_FOCUSED,
87 VISIBLE_TO_USER,
88 EDITABLE,
89 OPENS_POPUP,
90 DISMISSABLE,
91 MULTI_LINE,
92 CONTENT_INVALID,
93 CONTEXT_CLICKABLE,
94 IMPORTANCE
17 }; 95 };
18 96
19 // AccessibilityNodeInfoData is a struct to contain info of 97 // AccessibilityNodeInfoData is a struct to contain info of
20 // AccessibilityNodeInfo in Android. 98 // AccessibilityNodeInfo in Android.
21 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html 99 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityNodeInfo.html
22 struct AccessibilityNodeInfoData { 100 struct AccessibilityNodeInfoData {
23 ScreenRect boundsInScreen; 101 ScreenRect boundsInScreen;
102 int32 id;
yawano 2017/02/09 10:55:30 I think this will correspond to AccessibilityNodeI
103 string contentDescription;
dmazzoni 2017/02/09 01:18:09 how about map<> stringProperties?
yawano 2017/02/09 10:55:30 +1 for map<AccessibilityStringProperty> as it will
104 string text;
105 string className;
106 map<AccessibilityBooleanProperty, bool> booleanProperties;
107 array<int32> childIds;
yawano 2017/02/09 10:55:30 Add [MinVersion=1] to the new fields to keep backw
108 };
109
110 // Filters the event type (and implicitly the data) sent by the ARC accessibilit y service.
111 enum AccessibilityFilterType {
yawano 2017/02/09 10:55:30 Mark this [Extensible] as we can extend this later
112 // No events will be sent.
113 OFF,
114
115 // Only send focus events along with the source focus node.
116 FOCUS,
117
118 // Send a complete tree from the event source's root for every event.
dmazzoni 2017/02/09 01:18:09 nit: indent
119 ALL
120 };
121
122 // AccessibilityEventData is a struct to contain info of
123 // AccessibilityEvent in Android.
124 // https://developer.android.com/reference/android/view/accessibility/Accessibil ityEvent.html
125 struct AccessibilityEventData {
126 AccessibilityEventType eventType;
127 int32 sourceId;
128 array<AccessibilityNodeInfoData> nodeData;
24 }; 129 };
25 130
26 // Next method ID: 1 131 // Next method ID: 1
27 interface AccessibilityHelperHost { 132 interface AccessibilityHelperHost {
28 // OnAccessibilityEvent is called when a converted Android accessibility event 133 // OnAccessibilityEvent is called when a converted Android accessibility event
29 // is sent from Android. 134 // is sent from Android.
30 OnAccessibilityEvent@0(AccessibilityEventType eventType, 135 OnAccessibilityEvent@0(AccessibilityEventData eventData);
yawano 2017/02/09 10:55:30 We cannot simply change the arguments of existing
31 AccessibilityNodeInfoData? eventSource);
32 }; 136 };
33 137
34 // Next method ID: 1 138 // Next method ID: 3
35 interface AccessibilityHelperInstance { 139 interface AccessibilityHelperInstance {
36 Init@0(AccessibilityHelperHost host); 140 Init@0(AccessibilityHelperHost host);
141
142 // Perform the specified action on a node requested by a Chrome client.
143 PerformAction@1(int32 id, AccessibilityActionType action);
144
145 // Set a filter on the event types received.
146 SetFilter@2(AccessibilityFilterType filterType);
37 }; 147 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698