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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.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: Fix failing test 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: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
index 2d8b6336810dbbc3ef19d7f8777296bed3ee96d0..5ce725782a660fa291227797117f72ba612edf9f 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
@@ -19,7 +19,6 @@ import android.webkit.ValueCallback;
import org.chromium.base.ContentUriUtils;
import org.chromium.base.ThreadUtils;
-import org.chromium.content.browser.ContentVideoView;
/**
* Adapts the AwWebContentsDelegate interface to the AwContentsClient interface.
@@ -29,17 +28,19 @@ import org.chromium.content.browser.ContentVideoView;
class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
private static final String TAG = "AwWebContentsDelegateAdapter";
- final AwContents mAwContents;
- final AwContentsClient mContentsClient;
- View mContainerView;
- final Context mContext;
+ private final AwContents mAwContents;
+ private final AwContentsClient mContentsClient;
+ private final AwContentViewClient mContentViewClient;
+ private final Context mContext;
+ private View mContainerView;
public AwWebContentsDelegateAdapter(AwContents awContents, AwContentsClient contentsClient,
- View containerView, Context context) {
+ AwContentViewClient contentViewClient, Context context, View containerView) {
mAwContents = awContents;
mContentsClient = contentsClient;
- setContainerView(containerView);
+ mContentViewClient = contentViewClient;
mContext = context;
+ setContainerView(containerView);
}
public void setContainerView(View containerView) {
@@ -213,9 +214,10 @@ class AwWebContentsDelegateAdapter extends AwWebContentsDelegate {
@Override
public void toggleFullscreenModeForTab(boolean enterFullscreen) {
- if (!enterFullscreen) {
- ContentVideoView videoView = ContentVideoView.getContentVideoView();
- if (videoView != null) videoView.exitFullscreen(false);
+ if (enterFullscreen) {
+ mContentViewClient.enterFullscreen();
+ } else {
+ mContentViewClient.exitFullscreen();
}
}

Powered by Google App Engine
This is Rietveld 408576698