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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java

Issue 67473013: Support KitKat accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebaseline expectations Created 7 years, 1 month 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: content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
index 2180b480e7f46bd10b6e69def1cf7b06a551bf91..9f14032a90b8f5b53666c0b5c42bde9171ef9e55 100644
--- a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
+++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java
@@ -62,7 +62,10 @@ public class BrowserAccessibilityManager {
@CalledByNative
private static BrowserAccessibilityManager create(int nativeBrowserAccessibilityManagerAndroid,
ContentViewCore contentViewCore) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return new KitKatBrowserAccessibilityManager(
+ nativeBrowserAccessibilityManagerAndroid, contentViewCore);
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return new JellyBeanBrowserAccessibilityManager(
nativeBrowserAccessibilityManagerAndroid, contentViewCore);
} else {
@@ -241,6 +244,15 @@ public class BrowserAccessibilityManager {
mContentViewCore.getContainerView().requestSendAccessibilityEvent(mView, event);
}
+ private Bundle getOrCreateBundleForAccessibilityEvent(AccessibilityEvent event) {
+ Bundle bundle = (Bundle)event.getParcelableData();
+ if (bundle == null) {
+ bundle = new Bundle();
+ event.setParcelableData(bundle);
+ }
+ return bundle;
+ }
+
@CalledByNative
private void handlePageLoaded(int id) {
if (mUserHasTouchExplored) return;
@@ -396,6 +408,35 @@ public class BrowserAccessibilityManager {
}
@CalledByNative
+ protected void setAccessibilityNodeInfoKitKatAttributes(AccessibilityNodeInfo node,
+ boolean canOpenPopup,
+ boolean contentInvalid,
+ boolean dismissable,
+ boolean multiLine,
+ int inputType,
+ int liveRegion) {
+ // Requires KitKat or higher.
+ }
+
+ @CalledByNative
+ protected void setAccessibilityNodeInfoCollectionInfo(AccessibilityNodeInfo node,
+ int rowCount, int columnCount, boolean hierarchical) {
+ // Requires KitKat or higher.
+ }
+
+ @CalledByNative
+ protected void setAccessibilityNodeInfoCollectionItemInfo(AccessibilityNodeInfo node,
+ int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) {
+ // Requires KitKat or higher.
+ }
+
+ @CalledByNative
+ protected void setAccessibilityNodeInfoRangeInfo(AccessibilityNodeInfo node,
+ int rangeType, float min, float max, float current) {
+ // Requires KitKat or higher.
+ }
+
+ @CalledByNative
private void setAccessibilityEventBooleanAttributes(AccessibilityEvent event,
boolean checked, boolean enabled, boolean password, boolean scrollable) {
event.setChecked(checked);
@@ -444,6 +485,53 @@ public class BrowserAccessibilityManager {
event.getText().add(text);
}
+ @CalledByNative
+ protected void setAccessibilityEventKitKatAttributes(AccessibilityEvent event,
+ boolean canOpenPopup,
+ boolean contentInvalid,
+ boolean dismissable,
+ boolean multiLine,
+ int inputType,
+ int liveRegion) {
+ Bundle bundle = getOrCreateBundleForAccessibilityEvent(event);
+ bundle.putBoolean("canOpenPopup", canOpenPopup);
Peter Lundblad 2013/11/19 18:40:53 Since we are not doing any namespacing here, do we
+ bundle.putBoolean("contentInvalid", contentInvalid);
+ bundle.putBoolean("dismissable", dismissable);
+ bundle.putBoolean("multiLine", multiLine);
+ bundle.putInt("inputType", inputType);
+ bundle.putInt("liveRegion", liveRegion);
+ }
+
+ @CalledByNative
+ protected void setAccessibilityEventCollectionInfo(AccessibilityEvent event,
+ int rowCount, int columnCount, boolean hierarchical) {
+ Bundle bundle = getOrCreateBundleForAccessibilityEvent(event);
+ bundle.putInt("CollectionInfo.rowCount", rowCount);
+ bundle.putInt("CollectionInfo.columnCount", columnCount);
+ bundle.putBoolean("CollectionInfo.hierarchical", hierarchical);
+ }
+
+ @CalledByNative
+ protected void setAccessibilityEventCollectionItemInfo(AccessibilityEvent event,
+ int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) {
+ Bundle bundle = getOrCreateBundleForAccessibilityEvent(event);
+ bundle.putInt("CollectionItemInfo.rowIndex", rowIndex);
+ bundle.putInt("CollectionItemInfo.rowSpan", rowSpan);
+ bundle.putInt("CollectionItemInfo.columnIndex", columnIndex);
+ bundle.putInt("CollectionItemInfo.columnSpan", columnSpan);
+ bundle.putBoolean("CollectionItemInfo.heading", heading);
+ }
+
+ @CalledByNative
+ protected void setAccessibilityEventRangeInfo(AccessibilityEvent event,
+ int rangeType, float min, float max, float current) {
+ Bundle bundle = getOrCreateBundleForAccessibilityEvent(event);
+ bundle.putInt("RangeInfo.type", rangeType);
+ bundle.putFloat("RangeInfo.min", min);
+ bundle.putFloat("RangeInfo.max", max);
+ bundle.putFloat("RangeInfo.current", current);
+ }
+
private native int nativeGetRootId(int nativeBrowserAccessibilityManagerAndroid);
private native int nativeHitTest(int nativeBrowserAccessibilityManagerAndroid, int x, int y);
private native boolean nativePopulateAccessibilityNodeInfo(

Powered by Google App Engine
This is Rietveld 408576698