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

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

Issue 67473013: Support KitKat accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add dummy Mac and Win expectations Created 7 years 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/KitKatBrowserAccessibilityManager.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/KitKatBrowserAccessibilityManager.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/KitKatBrowserAccessibilityManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..73e54fe8a0dd9dc299ccb7c71029cf00bec1d30a
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/KitKatBrowserAccessibilityManager.java
@@ -0,0 +1,97 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser.accessibility;
+
+import android.os.Bundle;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.accessibility.AccessibilityNodeProvider;
+
+import org.chromium.base.JNINamespace;
+import org.chromium.content.browser.ContentViewCore;
+
+import java.util.List;
+
+/**
+ * Subclass of BrowserAccessibilityManager for KitKat that creates an
+ * AccessibilityNodeProvider and delegates its implementation to this object.
+ */
+@JNINamespace("content")
+public class KitKatBrowserAccessibilityManager extends JellyBeanBrowserAccessibilityManager {
+ KitKatBrowserAccessibilityManager(long nativeBrowserAccessibilityManagerAndroid,
+ ContentViewCore contentViewCore) {
+ super(nativeBrowserAccessibilityManagerAndroid, contentViewCore);
+ }
+
+ @Override
+ protected void setAccessibilityNodeInfoKitKatAttributes(AccessibilityNodeInfo node,
+ boolean canOpenPopup,
+ boolean contentInvalid,
+ boolean dismissable,
+ boolean multiLine,
+ int inputType,
+ int liveRegion) {
+ node.setCanOpenPopup(canOpenPopup);
+ node.setContentInvalid(contentInvalid);
+ node.setDismissable(contentInvalid);
+ node.setMultiLine(multiLine);
+ node.setInputType(inputType);
+ node.setLiveRegion(liveRegion);
+ }
+
+ @Override
+ protected void setAccessibilityNodeInfoCollectionInfo(AccessibilityNodeInfo node,
+ int rowCount, int columnCount, boolean hierarchical) {
+ node.setCollectionInfo(AccessibilityNodeInfo.CollectionInfo.obtain(
+ rowCount, columnCount, hierarchical));
+ }
+
+ @Override
+ protected void setAccessibilityNodeInfoCollectionItemInfo(AccessibilityNodeInfo node,
+ int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) {
+ node.setCollectionItemInfo(AccessibilityNodeInfo.CollectionItemInfo.obtain(
+ rowIndex, rowSpan, columnIndex, columnSpan, heading));
+ }
+
+ @Override
+ protected void setAccessibilityNodeInfoRangeInfo(AccessibilityNodeInfo node,
+ int rangeType, float min, float max, float current) {
+ node.setRangeInfo(AccessibilityNodeInfo.RangeInfo.obtain(
+ rangeType, min, max, current));
+ }
+
+ @Override
+ protected void setAccessibilityEventKitKatAttributes(AccessibilityEvent event,
+ boolean canOpenPopup,
+ boolean contentInvalid,
+ boolean dismissable,
+ boolean multiLine,
+ int inputType,
+ int liveRegion) {
+ // This is just a fallback for pre-KitKat systems.
+ // Do nothing on KitKat and higher.
+ }
+
+ @Override
+ protected void setAccessibilityEventCollectionInfo(AccessibilityEvent event,
+ int rowCount, int columnCount, boolean hierarchical) {
+ // This is just a fallback for pre-KitKat systems.
+ // Do nothing on KitKat and higher.
+ }
+
+ @Override
+ protected void setAccessibilityEventCollectionItemInfo(AccessibilityEvent event,
+ int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) {
+ // This is just a fallback for pre-KitKat systems.
+ // Do nothing on KitKat and higher.
+ }
+
+ @Override
+ protected void setAccessibilityEventRangeInfo(AccessibilityEvent event,
+ int rangeType, float min, float max, float current) {
+ // This is just a fallback for pre-KitKat systems.
+ // Do nothing on KitKat and higher.
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698