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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/common/accessibility_helper.mojom
diff --git a/components/arc/common/accessibility_helper.mojom b/components/arc/common/accessibility_helper.mojom
index 325006dc5e6742dacd62fa609ca492efaec83812..5b465814751bb1f43afd3f53ae1f2d15bf3e9a4a 100644
--- a/components/arc/common/accessibility_helper.mojom
+++ b/components/arc/common/accessibility_helper.mojom
@@ -8,12 +8,90 @@ module arc.mojom;
import "screen_rect.mojom";
-// AccessibilityEventType is a enum which corresponds to event types of
-// AccessibilityEvent in Android.
+// AccessibilityEventType lists the possible accessibility events on Android.
// https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html
[Extensible]
enum AccessibilityEventType {
VIEW_FOCUSED,
+ VIEW_SELECTED,
+ VIEW_CLICKED,
+ VIEW_LONG_CLICKED,
+ VIEW_TEXT_CHANGED,
+ WINDOW_STATE_CHANGED,
dmazzoni 2017/02/09 01:18:09 Are these supposed to match the order of Android e
+ NOTIFICATION_STATE_CHANGED,
+ VIEW_HOVER_ENTER,
+ VIEW_HOVER_EXIT,
+ TOUCH_EXPLORATION_GESTURE_START,
+ TOUCH_EXPLORATION_GESTURE_END,
+ WINDOW_CONTENT_CHANGED,
+ VIEW_SCROLLED,
+ VIEW_TEXT_SELECTION_CHANGED,
+ ANNOUNCEMENT,
+ VIEW_ACCESSIBILITY_FOCUSED,
+ VIEW_ACCESSIBILITY_FOCUS_CLEARED,
+ VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
+ GESTURE_DETECTION_START,
+ GESTURE_DETECTION_END,
+ TOUCH_INTERACTION_START,
+ TOUCH_INTERACTION_END,
+ WINDOWS_CHANGED,
+ VIEW_CONTEXT_CLICKED,
+ ASSIST_READING_CONTEXT,
+};
+
+// AccessibilityActionType lists possible accessibility actions on Android.
+// https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html
+// Please note the omission of
dmazzoni 2017/02/09 01:18:09 Might be simpler to just map all of them even if s
+// NEXT_AT_MOVEMENT_GRANULARITY,
+// PREVIOUS_AT_MOVEMENT_GRANULARITY,
+// NEXT_HTML_ELEMENT,
+// PREVIOUS_HTML_ELEMENT
+// Also note the omission of argument type mappings e.g. for setting selection.
+[Extensible]
+enum AccessibilityActionType {
+ FOCUS,
+ CLEAR_FOCUS,
+ SELECT,
+ CLEAR_SELECTION,
+ CLICK,
+ LONG_CLICK,
+ ACCESSIBILITY_FOCUS,
+ CLEAR_ACCESSIBILITY_FOCUS,
+ SCROLL_FORWARD,
+ SCROLL_BACKWARD,
+COPY,
dmazzoni 2017/02/09 01:18:09 nit: some of these need indentation. Also, please
+ PASTE,
+ CUT,
+SET_SELECTION,
+ EXPAND,
+ COLLAPSE,
+DISMISS,
+ SET_TEXT
+};
+
+// Possible boolean properties set on an AccessibilityNodeInfo.
+// https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html
+[Extensible]
+enum AccessibilityBooleanProperty {
+ CHECKABLE,
dmazzoni 2017/02/09 01:18:09 sort
+ CHECKED,
+ FOCUSABLE,
+ FOCUSED,
+ SELECTED,
+ CLICKABLE,
+ LONG_CLICKABLE,
+ ENABLED,
+ PASSWORD,
+ SCROLLABLE,
+ ACCESSIBILITY_FOCUSED,
+ VISIBLE_TO_USER,
+ EDITABLE,
+ OPENS_POPUP,
+ DISMISSABLE,
+ MULTI_LINE,
+ CONTENT_INVALID,
+ CONTEXT_CLICKABLE,
+ IMPORTANCE
};
// AccessibilityNodeInfoData is a struct to contain info of
@@ -21,17 +99,49 @@ enum AccessibilityEventType {
// https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html
struct AccessibilityNodeInfoData {
ScreenRect boundsInScreen;
+ int32 id;
yawano 2017/02/09 10:55:30 I think this will correspond to AccessibilityNodeI
+ 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
+ string text;
+ string className;
+ map<AccessibilityBooleanProperty, bool> booleanProperties;
+ array<int32> childIds;
yawano 2017/02/09 10:55:30 Add [MinVersion=1] to the new fields to keep backw
+};
+
+// Filters the event type (and implicitly the data) sent by the ARC accessibility service.
+enum AccessibilityFilterType {
yawano 2017/02/09 10:55:30 Mark this [Extensible] as we can extend this later
+ // No events will be sent.
+ OFF,
+
+ // Only send focus events along with the source focus node.
+ FOCUS,
+
+// Send a complete tree from the event source's root for every event.
dmazzoni 2017/02/09 01:18:09 nit: indent
+ ALL
+};
+
+// AccessibilityEventData is a struct to contain info of
+// AccessibilityEvent in Android.
+// https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html
+struct AccessibilityEventData {
+ AccessibilityEventType eventType;
+ int32 sourceId;
+ array<AccessibilityNodeInfoData> nodeData;
};
// Next method ID: 1
interface AccessibilityHelperHost {
// OnAccessibilityEvent is called when a converted Android accessibility event
// is sent from Android.
- OnAccessibilityEvent@0(AccessibilityEventType eventType,
- AccessibilityNodeInfoData? eventSource);
+ OnAccessibilityEvent@0(AccessibilityEventData eventData);
yawano 2017/02/09 10:55:30 We cannot simply change the arguments of existing
};
-// Next method ID: 1
+// Next method ID: 3
interface AccessibilityHelperInstance {
Init@0(AccessibilityHelperHost host);
+
+ // Perform the specified action on a node requested by a Chrome client.
+ PerformAction@1(int32 id, AccessibilityActionType action);
+
+ // Set a filter on the event types received.
+ SetFilter@2(AccessibilityFilterType filterType);
};

Powered by Google App Engine
This is Rietveld 408576698