Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 618013003: Support fullscreen for non-video elements in the WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactorFullscreenNonMedia
Patch Set: Removed verbose comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
qinmin 2014/10/06 16:55:28 we call WebMediaPlayer::enterfullscreen() in Fulls
Ignacio Solla 2014/10/07 18:14:43 I added a comment to render_widget.cc. As discuss
+ } 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();
}

Powered by Google App Engine
This is Rietveld 408576698