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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.app.SearchManager; | 9 import android.app.SearchManager; |
10 import android.content.ClipboardManager; | 10 import android.content.ClipboardManager; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 | 290 |
291 // Handles native accessibility, i.e. without any script injection. | 291 // Handles native accessibility, i.e. without any script injection. |
292 private BrowserAccessibilityManager mBrowserAccessibilityManager; | 292 private BrowserAccessibilityManager mBrowserAccessibilityManager; |
293 | 293 |
294 // System accessibility service. | 294 // System accessibility service. |
295 private final AccessibilityManager mAccessibilityManager; | 295 private final AccessibilityManager mAccessibilityManager; |
296 | 296 |
297 // Accessibility touch exploration state. | 297 // Accessibility touch exploration state. |
298 private boolean mTouchExplorationEnabled; | 298 private boolean mTouchExplorationEnabled; |
299 | 299 |
300 // Whether accessibility focus should be set to the page when it finishes lo ading. | |
301 // This only applies if an accessibility service like TalkBack is running. | |
302 // This is desirable behavior for a browser window, but not for an embedded | |
303 // WebView. | |
304 private boolean mShouldSetAccessibilityFocusOnPageLoad; | |
305 | |
300 // Allows us to dynamically respond when the accessibility script injection flag changes. | 306 // Allows us to dynamically respond when the accessibility script injection flag changes. |
301 private ContentObserver mAccessibilityScriptInjectionObserver; | 307 private ContentObserver mAccessibilityScriptInjectionObserver; |
302 | 308 |
303 // Temporary notification to tell onSizeChanged to focus a form element, | 309 // Temporary notification to tell onSizeChanged to focus a form element, |
304 // because the OSK was just brought up. | 310 // because the OSK was just brought up. |
305 private final Rect mFocusPreOSKViewportRect = new Rect(); | 311 private final Rect mFocusPreOSKViewportRect = new Rect(); |
306 | 312 |
307 // On tap this will store the x, y coordinates of the touch. | 313 // On tap this will store the x, y coordinates of the touch. |
308 private int mLastTapX; | 314 private int mLastTapX; |
309 private int mLastTapY; | 315 private int mLastTapY; |
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2886 } | 2892 } |
2887 | 2893 |
2888 /** | 2894 /** |
2889 * Stop any TTS notifications that are currently going on. | 2895 * Stop any TTS notifications that are currently going on. |
2890 */ | 2896 */ |
2891 public void stopCurrentAccessibilityNotifications() { | 2897 public void stopCurrentAccessibilityNotifications() { |
2892 mAccessibilityInjector.onPageLostFocus(); | 2898 mAccessibilityInjector.onPageLostFocus(); |
2893 } | 2899 } |
2894 | 2900 |
2895 /** | 2901 /** |
2902 * Return whether or not we should set accessibility focus on page load. | |
2903 */ | |
2904 public boolean shouldSetAccessibilityFocusOnPageLoad() { | |
2905 return mShouldSetAccessibilityFocusOnPageLoad; | |
2906 } | |
2907 | |
2908 /** | |
2909 * Return whether or not we should set accessibility focus on page load. | |
hush (inactive)
2014/08/27 18:35:37
sorry for the commenting on this after it is commi
| |
2910 * This only applies if an accessibility service like TalkBack is running. | |
2911 * This is desirable behavior for a browser window, but not for an embedded | |
2912 * WebView. | |
2913 */ | |
2914 public void setShouldSetAccessibilityFocusOnPageLoad(boolean on) { | |
2915 mShouldSetAccessibilityFocusOnPageLoad = on; | |
2916 } | |
2917 | |
2918 /** | |
2896 * Inform WebKit that Fullscreen mode has been exited by the user. | 2919 * Inform WebKit that Fullscreen mode has been exited by the user. |
2897 */ | 2920 */ |
2898 public void exitFullscreen() { | 2921 public void exitFullscreen() { |
2899 assert mWebContents != null; | 2922 assert mWebContents != null; |
2900 mWebContents.exitFullscreen(); | 2923 mWebContents.exitFullscreen(); |
2901 } | 2924 } |
2902 | 2925 |
2903 /** | 2926 /** |
2904 * Changes whether hiding the top controls is enabled. | 2927 * Changes whether hiding the top controls is enabled. |
2905 * | 2928 * |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3207 private native void nativeWasResized(long nativeContentViewCoreImpl); | 3230 private native void nativeWasResized(long nativeContentViewCoreImpl); |
3208 | 3231 |
3209 private native void nativeSetAccessibilityEnabled( | 3232 private native void nativeSetAccessibilityEnabled( |
3210 long nativeContentViewCoreImpl, boolean enabled); | 3233 long nativeContentViewCoreImpl, boolean enabled); |
3211 | 3234 |
3212 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, | 3235 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, |
3213 int x, int y, int w, int h); | 3236 int x, int y, int w, int h); |
3214 | 3237 |
3215 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); | 3238 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); |
3216 } | 3239 } |
OLD | NEW |