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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java

Issue 597523003: Remove the legacy fullscreen video path in Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase correctly Created 6 years, 3 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
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
index 6c2842f19635061e1e2b11ce30b5e245f0287a01..a091d775ffe8ebbf9c60c9e8dae01e6c83c90c79 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java
@@ -11,11 +11,9 @@ import android.webkit.URLUtil;
import android.webkit.WebChromeClient;
import android.widget.FrameLayout;
-import org.chromium.base.CommandLine;
import org.chromium.content.browser.ContentVideoView;
import org.chromium.content.browser.ContentVideoViewClient;
import org.chromium.content.browser.ContentViewClient;
-import org.chromium.content.common.ContentSwitches;
/**
* ContentViewClient implementation for WebView
@@ -25,28 +23,6 @@ public class AwContentViewClient extends ContentViewClient {
private class AwContentVideoViewClient implements ContentVideoViewClient {
@Override
public boolean onShowCustomView(View view) {
- WebChromeClient.CustomViewCallback cb = new WebChromeClient.CustomViewCallback() {
- @Override
- public void onCustomViewHidden() {
- ContentVideoView contentVideoView = ContentVideoView.getContentVideoView();
- if (contentVideoView != null)
- contentVideoView.exitFullscreen(false);
- }
- };
- // TODO(igsolla): remove the legacy path (kept as a fallback if things go awry).
- if (!areHtmlControlsEnabled()) {
- onShowCustomViewLegacy(view, cb);
- } else {
- onShowCustomView(view, cb);
- }
- return true;
- }
-
- private void onShowCustomViewLegacy(View view, WebChromeClient.CustomViewCallback cb) {
- mAwContentsClient.onShowCustomView(view, cb);
- }
-
- private void onShowCustomView(View view, WebChromeClient.CustomViewCallback cb) {
final FrameLayout viewGroup = new FrameLayout(mContext);
viewGroup.addView(view);
viewGroup.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@@ -66,14 +42,21 @@ public class AwContentViewClient extends ContentViewClient {
}
}
});
+ WebChromeClient.CustomViewCallback cb = new WebChromeClient.CustomViewCallback() {
+ @Override
+ public void onCustomViewHidden() {
+ ContentVideoView contentVideoView = ContentVideoView.getContentVideoView();
+ if (contentVideoView != null)
+ contentVideoView.exitFullscreen(false);
+ }
+ };
mAwContentsClient.onShowCustomView(viewGroup, cb);
+ return true;
}
@Override
public void onDestroyContentVideoView() {
- if (areHtmlControlsEnabled()) {
- mAwContents.exitFullScreen();
- }
+ mAwContents.exitFullScreen();
mAwContentsClient.onHideCustomView();
}
@@ -128,9 +111,4 @@ public class AwContentViewClient extends ContentViewClient {
return mAwSettings != null ?
mAwSettings.getBlockNetworkLoads() && URLUtil.isNetworkUrl(url) : true;
}
-
- private static boolean areHtmlControlsEnabled() {
- return !CommandLine.getInstance().hasSwitch(
- ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE);
- }
}
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenVideoTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698