| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser.accessibility; | 5 package org.chromium.content.browser.accessibility; |
| 6 | 6 |
| 7 import android.accessibilityservice.AccessibilityServiceInfo; |
| 7 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
| 8 import android.os.Build; | 9 import android.os.Build; |
| 9 import android.os.Bundle; | 10 import android.os.Bundle; |
| 10 import android.view.accessibility.AccessibilityNodeInfo; | 11 import android.view.accessibility.AccessibilityNodeInfo; |
| 11 | 12 |
| 12 import org.chromium.base.annotations.JNINamespace; | 13 import org.chromium.base.annotations.JNINamespace; |
| 13 import org.chromium.content.browser.ContentViewCore; | 14 import org.chromium.content.browser.ContentViewCore; |
| 14 | 15 |
| 15 /** | 16 /** |
| 16 * Subclass of BrowserAccessibilityManager for KitKat. | 17 * Subclass of BrowserAccessibilityManager for KitKat. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 35 bundle.putCharSequence("AccessibilityNodeInfo.roleDescription", roleDesc
ription); | 36 bundle.putCharSequence("AccessibilityNodeInfo.roleDescription", roleDesc
ription); |
| 36 if (isRoot) { | 37 if (isRoot) { |
| 37 bundle.putCharSequence("ACTION_ARGUMENT_HTML_ELEMENT_STRING_VALUES", | 38 bundle.putCharSequence("ACTION_ARGUMENT_HTML_ELEMENT_STRING_VALUES", |
| 38 mSupportedHtmlElementTypes); | 39 mSupportedHtmlElementTypes); |
| 39 } | 40 } |
| 40 if (isEditableText) { | 41 if (isEditableText) { |
| 41 node.setEditable(true); | 42 node.setEditable(true); |
| 42 node.setTextSelection(selectionStartIndex, selectionEndIndex); | 43 node.setTextSelection(selectionStartIndex, selectionEndIndex); |
| 43 } | 44 } |
| 44 } | 45 } |
| 46 |
| 47 @Override |
| 48 protected int getAccessibilityServiceCapabilitiesMask() { |
| 49 int capabilitiesMask = 0; |
| 50 for (AccessibilityServiceInfo service : |
| 51 mAccessibilityManager.getEnabledAccessibilityServiceList( |
| 52 AccessibilityServiceInfo.FEEDBACK_ALL_MASK)) { |
| 53 capabilitiesMask |= service.getCapabilities(); |
| 54 } |
| 55 return capabilitiesMask; |
| 56 } |
| 45 } | 57 } |
| OLD | NEW |