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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 mGestureStateListeners = new ObserverList<GestureStateListener>(); | 385 mGestureStateListeners = new ObserverList<GestureStateListener>(); |
386 mGestureStateListenersIterator = mGestureStateListeners.rewindableIterat
or(); | 386 mGestureStateListenersIterator = mGestureStateListeners.rewindableIterat
or(); |
387 | 387 |
388 mEditable = Editable.Factory.getInstance().newEditable(""); | 388 mEditable = Editable.Factory.getInstance().newEditable(""); |
389 Selection.setSelection(mEditable, 0); | 389 Selection.setSelection(mEditable, 0); |
390 } | 390 } |
391 | 391 |
392 /** | 392 /** |
393 * @return The context used for creating this ContentViewCore. | 393 * @return The context used for creating this ContentViewCore. |
394 */ | 394 */ |
395 @CalledByNative | |
396 public Context getContext() { | 395 public Context getContext() { |
397 return mContext; | 396 return mContext; |
398 } | 397 } |
399 | 398 |
400 /** | 399 /** |
401 * @return The ViewGroup that all view actions of this ContentViewCore shoul
d interact with. | 400 * @return The ViewGroup that all view actions of this ContentViewCore shoul
d interact with. |
402 */ | 401 */ |
403 public ViewGroup getContainerView() { | 402 public ViewGroup getContainerView() { |
404 return mContainerView; | 403 return mContainerView; |
405 } | 404 } |
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2695 * Sets whether or not we should set accessibility focus on page load. | 2694 * Sets whether or not we should set accessibility focus on page load. |
2696 * This only applies if an accessibility service like TalkBack is running. | 2695 * This only applies if an accessibility service like TalkBack is running. |
2697 * This is desirable behavior for a browser window, but not for an embedded | 2696 * This is desirable behavior for a browser window, but not for an embedded |
2698 * WebView. | 2697 * WebView. |
2699 */ | 2698 */ |
2700 public void setShouldSetAccessibilityFocusOnPageLoad(boolean on) { | 2699 public void setShouldSetAccessibilityFocusOnPageLoad(boolean on) { |
2701 mShouldSetAccessibilityFocusOnPageLoad = on; | 2700 mShouldSetAccessibilityFocusOnPageLoad = on; |
2702 } | 2701 } |
2703 | 2702 |
2704 /** | 2703 /** |
| 2704 * |
2705 * @return The cached copy of render positions and scales. | 2705 * @return The cached copy of render positions and scales. |
2706 */ | 2706 */ |
2707 public RenderCoordinates getRenderCoordinates() { | 2707 public RenderCoordinates getRenderCoordinates() { |
2708 return mRenderCoordinates; | 2708 return mRenderCoordinates; |
2709 } | 2709 } |
2710 | 2710 |
2711 @CalledByNative | 2711 @CalledByNative |
2712 private static Rect createRect(int x, int y, int right, int bottom) { | 2712 private static Rect createRect(int x, int y, int right, int bottom) { |
2713 return new Rect(x, y, right, bottom); | 2713 return new Rect(x, y, right, bottom); |
2714 } | 2714 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2787 mTouchScrollInProgress = false; | 2787 mTouchScrollInProgress = false; |
2788 mPotentiallyActiveFlingCount = 0; | 2788 mPotentiallyActiveFlingCount = 0; |
2789 | 2789 |
2790 if (touchScrollInProgress) updateGestureStateListener(GestureEventType.S
CROLL_END); | 2790 if (touchScrollInProgress) updateGestureStateListener(GestureEventType.S
CROLL_END); |
2791 if (potentiallyActiveFlingCount > 0) updateGestureStateListener(GestureE
ventType.FLING_END); | 2791 if (potentiallyActiveFlingCount > 0) updateGestureStateListener(GestureE
ventType.FLING_END); |
2792 } | 2792 } |
2793 | 2793 |
2794 private native long nativeInit(long webContentsPtr, | 2794 private native long nativeInit(long webContentsPtr, |
2795 long viewAndroidPtr, long windowAndroidPtr, HashSet<Object> retained
ObjectSet); | 2795 long viewAndroidPtr, long windowAndroidPtr, HashSet<Object> retained
ObjectSet); |
2796 | 2796 |
2797 @CalledByNative | 2797 ContentVideoViewClient getContentVideoViewClient() { |
2798 private ContentVideoViewClient getContentVideoViewClient() { | |
2799 return getContentViewClient().getContentVideoViewClient(); | 2798 return getContentViewClient().getContentVideoViewClient(); |
2800 } | 2799 } |
2801 | 2800 |
2802 @CalledByNative | 2801 @CalledByNative |
2803 private boolean shouldBlockMediaRequest(String url) { | 2802 private boolean shouldBlockMediaRequest(String url) { |
2804 return getContentViewClient().shouldBlockMediaRequest(url); | 2803 return getContentViewClient().shouldBlockMediaRequest(url); |
2805 } | 2804 } |
2806 | 2805 |
2807 @CalledByNative | 2806 @CalledByNative |
2808 private void onNativeFlingStopped() { | 2807 private void onNativeFlingStopped() { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2931 private native void nativeWasResized(long nativeContentViewCoreImpl); | 2930 private native void nativeWasResized(long nativeContentViewCoreImpl); |
2932 | 2931 |
2933 private native void nativeSetAccessibilityEnabled( | 2932 private native void nativeSetAccessibilityEnabled( |
2934 long nativeContentViewCoreImpl, boolean enabled); | 2933 long nativeContentViewCoreImpl, boolean enabled); |
2935 | 2934 |
2936 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 2935 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
2937 int x, int y, int w, int h); | 2936 int x, int y, int w, int h); |
2938 | 2937 |
2939 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); | 2938 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); |
2940 } | 2939 } |
OLD | NEW |