1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.chromium.content.browser.accessibility;
7 import android.view.accessibility.AccessibilityEvent;
8 import android.view.accessibility.AccessibilityNodeInfo;
10 import org.chromium.base.JNINamespace;
11 import org.chromium.content.browser.ContentViewCore;
14 * Subclass of BrowserAccessibilityManager for KitKat that creates an
15 * AccessibilityNodeProvider and delegates its implementation to this object.
17 * THIS CLASS IS NOT USED! A bug in the KitKat framework prevents us
18 * from using these new APIs. We can re-enable this class after the next
19 * Android system update. http://crbug.com/348088/
21 @JNINamespace("content")
22 public class KitKatBrowserAccessibilityManager extends JellyBeanBrowserAccessibilityManager {
23 KitKatBrowserAccessibilityManager(long nativeBrowserAccessibilityManagerAndroid,
24 ContentViewCore contentViewCore) {
25 super(nativeBrowserAccessibilityManagerAndroid, contentViewCore);
29 protected void setAccessibilityNodeInfoKitKatAttributes(AccessibilityNodeInfo node,
31 boolean contentInvalid,
36 node.setCanOpenPopup(canOpenPopup);
37 node.setContentInvalid(contentInvalid);
38 node.setDismissable(contentInvalid);
39 node.setMultiLine(multiLine);
40 node.setInputType(inputType);
41 node.setLiveRegion(liveRegion);
45 protected void setAccessibilityNodeInfoCollectionInfo(AccessibilityNodeInfo node,
46 int rowCount, int columnCount, boolean hierarchical) {
47 node.setCollectionInfo(AccessibilityNodeInfo.CollectionInfo.obtain(
48 rowCount, columnCount, hierarchical));
52 protected void setAccessibilityNodeInfoCollectionItemInfo(AccessibilityNodeInfo node,
53 int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) {
54 node.setCollectionItemInfo(AccessibilityNodeInfo.CollectionItemInfo.obtain(
55 rowIndex, rowSpan, columnIndex, columnSpan, heading));
59 protected void setAccessibilityNodeInfoRangeInfo(AccessibilityNodeInfo node,
60 int rangeType, float min, float max, float current) {
61 node.setRangeInfo(AccessibilityNodeInfo.RangeInfo.obtain(
62 rangeType, min, max, current));
66 protected void setAccessibilityEventKitKatAttributes(AccessibilityEvent event,
68 boolean contentInvalid,
73 // This is just a fallback for pre-KitKat systems.
74 // Do nothing on KitKat and higher.
78 protected void setAccessibilityEventCollectionInfo(AccessibilityEvent event,
79 int rowCount, int columnCount, boolean hierarchical) {
80 // This is just a fallback for pre-KitKat systems.
81 // Do nothing on KitKat and higher.
85 protected void setAccessibilityEventCollectionItemInfo(AccessibilityEvent event,
86 int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading) {
87 // This is just a fallback for pre-KitKat systems.
88 // Do nothing on KitKat and higher.
92 protected void setAccessibilityEventRangeInfo(AccessibilityEvent event,
93 int rangeType, float min, float max, float current) {
94 // This is just a fallback for pre-KitKat systems.
95 // Do nothing on KitKat and higher.