Chromium Code Reviews| 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 * Inform WebKit that Fullscreen mode has been exited by the user | |
| 2705 * or the app (in the case of the WebView). | |
| 2706 */ | |
| 2707 public void exitFullscreen() { | |
| 2708 assert mWebContents != null; | |
| 2709 mWebContents.exitFullscreen(); | |
|
no sievers
2014/10/15 18:16:38
Is this needed? Doesn't AwContents have access to
Ignacio Solla
2014/10/15 18:38:42
This function was already here when I started with
| |
| 2710 } | |
| 2711 | |
| 2712 /** | |
| 2713 * | |
| 2705 * @return The cached copy of render positions and scales. | 2714 * @return The cached copy of render positions and scales. |
| 2706 */ | 2715 */ |
| 2707 public RenderCoordinates getRenderCoordinates() { | 2716 public RenderCoordinates getRenderCoordinates() { |
| 2708 return mRenderCoordinates; | 2717 return mRenderCoordinates; |
| 2709 } | 2718 } |
| 2710 | 2719 |
| 2711 @CalledByNative | 2720 @CalledByNative |
| 2712 private static Rect createRect(int x, int y, int right, int bottom) { | 2721 private static Rect createRect(int x, int y, int right, int bottom) { |
| 2713 return new Rect(x, y, right, bottom); | 2722 return new Rect(x, y, right, bottom); |
| 2714 } | 2723 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2787 mTouchScrollInProgress = false; | 2796 mTouchScrollInProgress = false; |
| 2788 mPotentiallyActiveFlingCount = 0; | 2797 mPotentiallyActiveFlingCount = 0; |
| 2789 | 2798 |
| 2790 if (touchScrollInProgress) updateGestureStateListener(GestureEventType.S CROLL_END); | 2799 if (touchScrollInProgress) updateGestureStateListener(GestureEventType.S CROLL_END); |
| 2791 if (potentiallyActiveFlingCount > 0) updateGestureStateListener(GestureE ventType.FLING_END); | 2800 if (potentiallyActiveFlingCount > 0) updateGestureStateListener(GestureE ventType.FLING_END); |
| 2792 } | 2801 } |
| 2793 | 2802 |
| 2794 private native long nativeInit(long webContentsPtr, | 2803 private native long nativeInit(long webContentsPtr, |
| 2795 long viewAndroidPtr, long windowAndroidPtr, HashSet<Object> retained ObjectSet); | 2804 long viewAndroidPtr, long windowAndroidPtr, HashSet<Object> retained ObjectSet); |
| 2796 | 2805 |
| 2797 @CalledByNative | 2806 ContentVideoViewClient getContentVideoViewClient() { |
| 2798 private ContentVideoViewClient getContentVideoViewClient() { | |
| 2799 return getContentViewClient().getContentVideoViewClient(); | 2807 return getContentViewClient().getContentVideoViewClient(); |
| 2800 } | 2808 } |
| 2801 | 2809 |
| 2802 @CalledByNative | 2810 @CalledByNative |
| 2803 private boolean shouldBlockMediaRequest(String url) { | 2811 private boolean shouldBlockMediaRequest(String url) { |
| 2804 return getContentViewClient().shouldBlockMediaRequest(url); | 2812 return getContentViewClient().shouldBlockMediaRequest(url); |
| 2805 } | 2813 } |
| 2806 | 2814 |
| 2807 @CalledByNative | 2815 @CalledByNative |
| 2808 private void onNativeFlingStopped() { | 2816 private void onNativeFlingStopped() { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2931 private native void nativeWasResized(long nativeContentViewCoreImpl); | 2939 private native void nativeWasResized(long nativeContentViewCoreImpl); |
| 2932 | 2940 |
| 2933 private native void nativeSetAccessibilityEnabled( | 2941 private native void nativeSetAccessibilityEnabled( |
| 2934 long nativeContentViewCoreImpl, boolean enabled); | 2942 long nativeContentViewCoreImpl, boolean enabled); |
| 2935 | 2943 |
| 2936 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, | 2944 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp l, |
| 2937 int x, int y, int w, int h); | 2945 int x, int y, int w, int h); |
| 2938 | 2946 |
| 2939 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); | 2947 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl , boolean opaque); |
| 2940 } | 2948 } |
| OLD | NEW |