| 1 | // Copyright (c) 2012 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; |
| 6 | |
| 7 | import android.content.Context; |
| 8 | import android.os.Bundle; |
| 9 | import android.util.AttributeSet; |
| 10 | import android.view.View; |
| 11 | import android.view.accessibility.AccessibilityNodeInfo; |
| 12 | import android.view.accessibility.AccessibilityNodeProvider; |
| 13 | |
| 14 | import org.chromium.ui.WindowAndroid; |
| 15 | |
| 16 | /** |
| 17 | * A version of {@link ContentView} that supports JellyBean features. |
| 18 | */ |
| 19 | class JellyBeanContentView extends ContentView { |
| 20 | JellyBeanContentView(Context context, int nativeWebContents, WindowAndroid windowAndroid, |
| 21 | AttributeSet attrs, int defStyle) { |
| 22 | super(context, nativeWebContents, windowAndroid, attrs, defStyle); |
| 23 | } |
| 24 | |
| 25 | @Override |
| 26 | public boolean performAccessibilityAction(int action, Bundle arguments) { |
| 27 | if (getContentViewCore().supportsAccessibilityAction(action)) { |
| 28 | return getContentViewCore().performAccessibilityAction(action, arguments); |
| 29 | } |
| 30 | |
| 31 | return super.performAccessibilityAction(action, arguments); |
| 32 | } |
| 33 | |
| 34 | @Override |
| 35 | public AccessibilityNodeProvider getAccessibilityNodeProvider() { |
| 36 | AccessibilityNodeProvider provider = getContentViewCore().getAccessibilityNodeProvider(); |
| 37 | if (provider != null) { |
| 38 | return provider; |
| 39 | } else { |
| 40 | return super.getAccessibilityNodeProvider(); |
| 41 | } |
| 42 | } |
| 43 | } |