| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| index 85e2da86ed8c4907dbfa32eca7c72bd3bbe5f88c..091f9ae8ba6ba6e5bd0459685d940488606a27a1 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| @@ -361,6 +361,9 @@ public class ContentViewCore
|
| // screen orientation.
|
| private boolean mFullscreenRequiredForOrientationLock = true;
|
|
|
| + // The accelerated view for fullscreen video playback.
|
| + private ContentVideoView mVideoView;
|
| +
|
| /**
|
| * Constructs a new ContentViewCore. Embedders must call initialize() after constructing
|
| * a ContentViewCore and before using it.
|
| @@ -393,7 +396,6 @@ public class ContentViewCore
|
| /**
|
| * @return The context used for creating this ContentViewCore.
|
| */
|
| - @CalledByNative
|
| public Context getContext() {
|
| return mContext;
|
| }
|
| @@ -2778,7 +2780,8 @@ public class ContentViewCore
|
| }
|
|
|
| /**
|
| - * Inform WebKit that Fullscreen mode has been exited by the user.
|
| + * Inform WebKit that Fullscreen mode has been exited by the user
|
| + * or the app (in the case of the WebView).
|
| */
|
| public void exitFullscreen() {
|
| assert mWebContents != null;
|
| @@ -2786,6 +2789,33 @@ public class ContentViewCore
|
| }
|
|
|
| /**
|
| + * The {@link ContentVideoView} that must be shown when the {@link #onDidEnterFullscreen()}
|
| + * callback is received.
|
| + */
|
| + void setContentVideoView(ContentVideoView videoView) {
|
| + mVideoView = videoView;
|
| + }
|
| +
|
| + @CalledByNative
|
| + private void onDidEnterFullscreen() {
|
| + if (mVideoView != null) {
|
| + getContentVideoViewClient().enterFullscreenVideo(mVideoView);
|
| + } else {
|
| + getContentViewClient().enterFullscreen();
|
| + }
|
| + }
|
| +
|
| + @CalledByNative
|
| + private void onDidExitFullscreen() {
|
| + if (mVideoView != null) {
|
| + getContentVideoViewClient().exitFullscreenVideo();
|
| + mVideoView = null;
|
| + } else {
|
| + getContentViewClient().exitFullscreen();
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Changes whether hiding the top controls is enabled.
|
| *
|
| * @param enableHiding Whether hiding the top controls should be enabled or not.
|
| @@ -2892,8 +2922,7 @@ public class ContentViewCore
|
| private native long nativeInit(long webContentsPtr,
|
| long viewAndroidPtr, long windowAndroidPtr, HashSet<Object> retainedObjectSet);
|
|
|
| - @CalledByNative
|
| - private ContentVideoViewClient getContentVideoViewClient() {
|
| + ContentVideoViewClient getContentVideoViewClient() {
|
| return getContentViewClient().getContentVideoViewClient();
|
| }
|
|
|
|
|