| 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);
|
| - }
|
| }
|
|
|