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 mNativeAccessibilityAllowed = false; | |
2986 return; | 2987 return; |
2987 } | 2988 } |
2988 | 2989 |
2989 if (isDeviceAccessibilityScriptInjectionEnabled()) { | 2990 if (isDeviceAccessibilityScriptInjectionEnabled()) { |
2990 setInjectedAccessibility(true); | 2991 setInjectedAccessibility(true); |
2992 mNativeAccessibilityAllowed = false; | |
2991 return; | 2993 return; |
2992 } | 2994 } |
2993 | 2995 |
2994 mNativeAccessibilityAllowed = true; | 2996 mNativeAccessibilityAllowed = true; |
joth
2013/09/25 11:41:28
bool use_chromevox = isDeviceAccessibilityScriptIn
| |
2995 } | 2997 } |
2996 | 2998 |
2997 /** | 2999 /** |
2998 * Enable or disable injected accessibility features | 3000 * Enable or disable injected accessibility features |
2999 */ | 3001 */ |
3000 public void setInjectedAccessibility(boolean enabled) { | 3002 public void setInjectedAccessibility(boolean enabled) { |
3001 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary(); | 3003 mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary(); |
3002 mAccessibilityInjector.setScriptEnabled(enabled); | 3004 mAccessibilityInjector.setScriptEnabled(enabled); |
3003 } | 3005 } |
3004 | 3006 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3295 | 3297 |
3296 private native void nativeAttachExternalVideoSurface( | 3298 private native void nativeAttachExternalVideoSurface( |
3297 int nativeContentViewCoreImpl, int playerId, Surface surface); | 3299 int nativeContentViewCoreImpl, int playerId, Surface surface); |
3298 | 3300 |
3299 private native void nativeDetachExternalVideoSurface( | 3301 private native void nativeDetachExternalVideoSurface( |
3300 int nativeContentViewCoreImpl, int playerId); | 3302 int nativeContentViewCoreImpl, int playerId); |
3301 | 3303 |
3302 private native void nativeSetAccessibilityEnabled( | 3304 private native void nativeSetAccessibilityEnabled( |
3303 int nativeContentViewCoreImpl, boolean enabled); | 3305 int nativeContentViewCoreImpl, boolean enabled); |
3304 } | 3306 } |
OLD | NEW |