OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Rect; | 8 import android.graphics.Rect; |
9 import android.os.Build; | 9 import android.os.Build; |
10 import android.os.Bundle; | 10 import android.os.Bundle; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 private boolean isFrameInfoInitialized() { | 364 private boolean isFrameInfoInitialized() { |
365 return mRenderCoordinates.getContentWidthCss() != 0.0 || | 365 return mRenderCoordinates.getContentWidthCss() != 0.0 || |
366 mRenderCoordinates.getContentHeightCss() != 0.0; | 366 mRenderCoordinates.getContentHeightCss() != 0.0; |
367 } | 367 } |
368 | 368 |
369 @CalledByNative | 369 @CalledByNative |
370 private void handlePageLoaded(int id) { | 370 private void handlePageLoaded(int id) { |
371 if (mUserHasTouchExplored) return; | 371 if (mUserHasTouchExplored) return; |
372 | 372 |
373 mAccessibilityFocusId = id; | 373 if (mContentViewCore.shouldSetAccessibilityFocusOnPageLoad()) { |
374 sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FO
CUSED); | 374 mAccessibilityFocusId = id; |
| 375 sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_ACCESSIBILIT
Y_FOCUSED); |
| 376 } |
375 } | 377 } |
376 | 378 |
377 @CalledByNative | 379 @CalledByNative |
378 private void handleFocusChanged(int id) { | 380 private void handleFocusChanged(int id) { |
379 sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_FOCUSED); | 381 sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_FOCUSED); |
380 | 382 |
381 // Update accessibility focus if not already set to this node. | 383 // Update accessibility focus if not already set to this node. |
382 if (mAccessibilityFocusId != id) { | 384 if (mAccessibilityFocusId != id) { |
383 sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_ACCESSIBILIT
Y_FOCUSED); | 385 sendAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_ACCESSIBILIT
Y_FOCUSED); |
384 mAccessibilityFocusId = id; | 386 mAccessibilityFocusId = id; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 long nativeBrowserAccessibilityManagerAndroid, AccessibilityEvent event,
int id, | 695 long nativeBrowserAccessibilityManagerAndroid, AccessibilityEvent event,
int id, |
694 int eventType); | 696 int eventType); |
695 private native void nativeClick(long nativeBrowserAccessibilityManagerAndroi
d, int id); | 697 private native void nativeClick(long nativeBrowserAccessibilityManagerAndroi
d, int id); |
696 private native void nativeFocus(long nativeBrowserAccessibilityManagerAndroi
d, int id); | 698 private native void nativeFocus(long nativeBrowserAccessibilityManagerAndroi
d, int id); |
697 private native void nativeBlur(long nativeBrowserAccessibilityManagerAndroid
); | 699 private native void nativeBlur(long nativeBrowserAccessibilityManagerAndroid
); |
698 private native void nativeScrollToMakeNodeVisible( | 700 private native void nativeScrollToMakeNodeVisible( |
699 long nativeBrowserAccessibilityManagerAndroid, int id); | 701 long nativeBrowserAccessibilityManagerAndroid, int id); |
700 private native int nativeFindElementType(long nativeBrowserAccessibilityMana
gerAndroid, | 702 private native int nativeFindElementType(long nativeBrowserAccessibilityMana
gerAndroid, |
701 int startId, String elementType, boolean forwards); | 703 int startId, String elementType, boolean forwards); |
702 } | 704 } |
OLD | NEW |