OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.SearchManager; | 8 import android.app.SearchManager; |
9 import android.content.ContentResolver; | 9 import android.content.ContentResolver; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 | 2976 |
2977 /** | 2977 /** |
2978 * Turns browser accessibility on or off. | 2978 * Turns browser accessibility on or off. |
2979 * If |state| is |false|, this turns off both native and injected accessibil
ity. | 2979 * If |state| is |false|, this turns off both native and injected accessibil
ity. |
2980 * Otherwise, if accessibility script injection is enabled, this will enable
the injected | 2980 * Otherwise, if accessibility script injection is enabled, this will enable
the injected |
2981 * accessibility scripts. Native accessibility is enabled on demand. | 2981 * accessibility scripts. Native accessibility is enabled on demand. |
2982 */ | 2982 */ |
2983 public void setAccessibilityState(boolean state) { | 2983 public void setAccessibilityState(boolean state) { |
2984 if (!state) { | 2984 if (!state) { |
2985 setInjectedAccessibility(false); | 2985 setInjectedAccessibility(false); |
2986 return; | 2986 mNativeAccessibilityAllowed = false; |
| 2987 } else { |
| 2988 boolean useScriptInjection = isDeviceAccessibilityScriptInjectionEna
bled(); |
| 2989 setInjectedAccessibility(useScriptInjection); |
| 2990 mNativeAccessibilityAllowed = !useScriptInjection; |
2987 } | 2991 } |
2988 | |
2989 if (isDeviceAccessibilityScriptInjectionEnabled()) { | |
2990 setInjectedAccessibility(true); | |
2991 return; | |
2992 } | |
2993 | |
2994 mNativeAccessibilityAllowed = true; | |
2995 } | 2992 } |
2996 | 2993 |
2997 /** | 2994 /** |
2998 * Enable or disable injected accessibility features | 2995 * Enable or disable injected accessibility features |
2999 */ | 2996 */ |
3000 public void setInjectedAccessibility(boolean enabled) { | 2997 public void setInjectedAccessibility(boolean enabled) { |
3001 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary(); | 2998 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary(); |
3002 mAccessibilityInjector.setScriptEnabled(enabled); | 2999 mAccessibilityInjector.setScriptEnabled(enabled); |
3003 } | 3000 } |
3004 | 3001 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3295 | 3292 |
3296 private native void nativeAttachExternalVideoSurface( | 3293 private native void nativeAttachExternalVideoSurface( |
3297 int nativeContentViewCoreImpl, int playerId, Surface surface); | 3294 int nativeContentViewCoreImpl, int playerId, Surface surface); |
3298 | 3295 |
3299 private native void nativeDetachExternalVideoSurface( | 3296 private native void nativeDetachExternalVideoSurface( |
3300 int nativeContentViewCoreImpl, int playerId); | 3297 int nativeContentViewCoreImpl, int playerId); |
3301 | 3298 |
3302 private native void nativeSetAccessibilityEnabled( | 3299 private native void nativeSetAccessibilityEnabled( |
3303 int nativeContentViewCoreImpl, boolean enabled); | 3300 int nativeContentViewCoreImpl, boolean enabled); |
3304 } | 3301 } |
OLD | NEW |