OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 package org.chromium.content.browser.accessibility; |
| 6 |
| 7 import android.os.Bundle; |
| 8 import android.view.accessibility.AccessibilityEvent; |
| 9 import android.view.accessibility.AccessibilityNodeInfo; |
| 10 import android.view.accessibility.AccessibilityNodeProvider; |
| 11 |
| 12 import org.chromium.base.JNINamespace; |
| 13 import org.chromium.content.browser.ContentViewCore; |
| 14 |
| 15 import java.util.List; |
| 16 |
| 17 /** |
| 18 * Subclass of BrowserAccessibilityManager for KitKat that creates an |
| 19 * AccessibilityNodeProvider and delegates its implementation to this object. |
| 20 */ |
| 21 @JNINamespace("content") |
| 22 public class KitKatBrowserAccessibilityManager extends JellyBeanBrowserAccessibi
lityManager { |
| 23 KitKatBrowserAccessibilityManager(long nativeBrowserAccessibilityManagerAndr
oid, |
| 24 ContentViewCore contentViewCore) { |
| 25 super(nativeBrowserAccessibilityManagerAndroid, contentViewCore); |
| 26 } |
| 27 |
| 28 @Override |
| 29 protected void setAccessibilityNodeInfoKitKatAttributes(AccessibilityNodeInf
o node, |
| 30 boolean canOpenPopup, |
| 31 boolean contentInvalid, |
| 32 boolean dismissable, |
| 33 boolean multiLine, |
| 34 int inputType, |
| 35 int liveRegion) { |
| 36 node.setCanOpenPopup(canOpenPopup); |
| 37 node.setContentInvalid(contentInvalid); |
| 38 node.setDismissable(contentInvalid); |
| 39 node.setMultiLine(multiLine); |
| 40 node.setInputType(inputType); |
| 41 node.setLiveRegion(liveRegion); |
| 42 } |
| 43 |
| 44 @Override |
| 45 protected void setAccessibilityNodeInfoCollectionInfo(AccessibilityNodeInfo
node, |
| 46 int rowCount, int columnCount, boolean hierarchical) { |
| 47 node.setCollectionInfo(AccessibilityNodeInfo.CollectionInfo.obtain( |
| 48 rowCount, columnCount, hierarchical)); |
| 49 } |
| 50 |
| 51 @Override |
| 52 protected void setAccessibilityNodeInfoCollectionItemInfo(AccessibilityNodeI
nfo node, |
| 53 int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean
heading) { |
| 54 node.setCollectionItemInfo(AccessibilityNodeInfo.CollectionItemInfo.obta
in( |
| 55 rowIndex, rowSpan, columnIndex, columnSpan, heading)); |
| 56 } |
| 57 |
| 58 @Override |
| 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)); |
| 63 } |
| 64 |
| 65 @Override |
| 66 protected void setAccessibilityEventKitKatAttributes(AccessibilityEvent even
t, |
| 67 boolean canOpenPopup, |
| 68 boolean contentInvalid, |
| 69 boolean dismissable, |
| 70 boolean multiLine, |
| 71 int inputType, |
| 72 int liveRegion) { |
| 73 // This is just a fallback for pre-KitKat systems. |
| 74 // Do nothing on KitKat and higher. |
| 75 } |
| 76 |
| 77 @Override |
| 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. |
| 82 } |
| 83 |
| 84 @Override |
| 85 protected void setAccessibilityEventCollectionItemInfo(AccessibilityEvent ev
ent, |
| 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. |
| 89 } |
| 90 |
| 91 @Override |
| 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. |
| 96 } |
| 97 } |
OLD | NEW |