Commit 62f3270d authored by igsolla's avatar igsolla Committed by Commit bot

Remove the legacy fullscreen video path in Android.

Remove the legacy fullscreen video path that was used before
html5 video controls were introduced. The last user was the
WebView, but this has been migrated to html5 controls now.

Review URL: https://codereview.chromium.org/597523003

Cr-Commit-Position: refs/heads/master@{#296935}
parent c312255d
...@@ -11,11 +11,9 @@ import android.webkit.URLUtil; ...@@ -11,11 +11,9 @@ import android.webkit.URLUtil;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import org.chromium.base.CommandLine;
import org.chromium.content.browser.ContentVideoView; import org.chromium.content.browser.ContentVideoView;
import org.chromium.content.browser.ContentVideoViewClient; import org.chromium.content.browser.ContentVideoViewClient;
import org.chromium.content.browser.ContentViewClient; import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.common.ContentSwitches;
/** /**
* ContentViewClient implementation for WebView * ContentViewClient implementation for WebView
...@@ -25,28 +23,6 @@ public class AwContentViewClient extends ContentViewClient { ...@@ -25,28 +23,6 @@ public class AwContentViewClient extends ContentViewClient {
private class AwContentVideoViewClient implements ContentVideoViewClient { private class AwContentVideoViewClient implements ContentVideoViewClient {
@Override @Override
public boolean onShowCustomView(View view) { 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); final FrameLayout viewGroup = new FrameLayout(mContext);
viewGroup.addView(view); viewGroup.addView(view);
viewGroup.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { viewGroup.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
...@@ -66,14 +42,21 @@ public class AwContentViewClient extends ContentViewClient { ...@@ -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); mAwContentsClient.onShowCustomView(viewGroup, cb);
return true;
} }
@Override @Override
public void onDestroyContentVideoView() { public void onDestroyContentVideoView() {
if (areHtmlControlsEnabled()) {
mAwContents.exitFullScreen(); mAwContents.exitFullScreen();
}
mAwContentsClient.onHideCustomView(); mAwContentsClient.onHideCustomView();
} }
...@@ -128,9 +111,4 @@ public class AwContentViewClient extends ContentViewClient { ...@@ -128,9 +111,4 @@ public class AwContentViewClient extends ContentViewClient {
return mAwSettings != null ? return mAwSettings != null ?
mAwSettings.getBlockNetworkLoads() && URLUtil.isNetworkUrl(url) : true; mAwSettings.getBlockNetworkLoads() && URLUtil.isNetworkUrl(url) : true;
} }
private static boolean areHtmlControlsEnabled() {
return !CommandLine.getInstance().hasSwitch(
ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE);
}
} }
...@@ -5,19 +5,15 @@ ...@@ -5,19 +5,15 @@
package org.chromium.android_webview.test; package org.chromium.android_webview.test;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.view.KeyEvent;
import android.view.View;
import junit.framework.Assert; import junit.framework.Assert;
import org.chromium.android_webview.test.util.JavascriptEventObserver; import org.chromium.android_webview.test.util.JavascriptEventObserver;
import org.chromium.android_webview.test.util.VideoTestWebServer; import org.chromium.android_webview.test.util.VideoTestWebServer;
import org.chromium.base.CommandLine;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.DOMUtils; import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TouchCommon; import org.chromium.content.browser.test.util.TouchCommon;
import org.chromium.content.common.ContentSwitches;
/** /**
* Test WebChromeClient::onShow/HideCustomView. * Test WebChromeClient::onShow/HideCustomView.
...@@ -58,26 +54,6 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase { ...@@ -58,26 +54,6 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
}); });
} }
@MediumTest
@Feature({"AndroidWebView"})
public void testOnShowAndHideCustomViewWithBackKeyLegacy() throws Throwable {
// When html controls are enabled we skip this test because pressing the back key
// moves away from the current activity instead of exiting fullscreen mode.
if (areHtmlControlsEnabled())
return;
doOnShowAndHideCustomViewTest(new Runnable() {
@Override
public void run() {
View customView = mContentsClient.getCustomView();
customView.dispatchKeyEvent(
new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
customView.dispatchKeyEvent(
new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));
}
});
}
@MediumTest @MediumTest
@Feature({"AndroidWebView"}) @Feature({"AndroidWebView"})
public void testOnShowAndHideCustomViewWithJavascript() throws Throwable { public void testOnShowAndHideCustomViewWithJavascript() throws Throwable {
...@@ -92,9 +68,6 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase { ...@@ -92,9 +68,6 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
@MediumTest @MediumTest
@Feature({"AndroidWebView"}) @Feature({"AndroidWebView"})
public void testOnShowCustomViewAndPlayWithHtmlControl() throws Throwable { public void testOnShowCustomViewAndPlayWithHtmlControl() throws Throwable {
if (!areHtmlControlsEnabled())
return;
doOnShowCustomViewTest(); doOnShowCustomViewTest();
Assert.assertFalse(DOMUtils.hasVideoEnded( Assert.assertFalse(DOMUtils.hasVideoEnded(
mContentViewCore, VideoTestWebServer.VIDEO_ID)); mContentViewCore, VideoTestWebServer.VIDEO_ID));
...@@ -130,11 +103,6 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase { ...@@ -130,11 +103,6 @@ public class AwContentsClientFullScreenVideoTest extends AwTestBase {
Assert.assertFalse(mContentsClient.wasCustomViewShownCalled()); Assert.assertFalse(mContentsClient.wasCustomViewShownCalled());
} }
private static boolean areHtmlControlsEnabled() {
return !CommandLine.getInstance().hasSwitch(
ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE);
}
private void doOnShowAndHideCustomViewTest(final Runnable existFullscreen) private void doOnShowAndHideCustomViewTest(final Runnable existFullscreen)
throws Throwable { throws Throwable {
doOnShowCustomViewTest(); doOnShowCustomViewTest();
......
...@@ -37,7 +37,6 @@ import org.chromium.content.browser.ActivityContentVideoViewClient; ...@@ -37,7 +37,6 @@ import org.chromium.content.browser.ActivityContentVideoViewClient;
import org.chromium.content.browser.BrowserStartupController; import org.chromium.content.browser.BrowserStartupController;
import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.DeviceUtils; import org.chromium.content.browser.DeviceUtils;
import org.chromium.content.common.ContentSwitches;
import org.chromium.printing.PrintManagerDelegateImpl; import org.chromium.printing.PrintManagerDelegateImpl;
import org.chromium.printing.PrintingController; import org.chromium.printing.PrintingController;
import org.chromium.sync.signin.AccountManagerHelper; import org.chromium.sync.signin.AccountManagerHelper;
...@@ -141,18 +140,14 @@ public class ChromeShellActivity extends Activity implements AppMenuPropertiesDe ...@@ -141,18 +140,14 @@ public class ChromeShellActivity extends Activity implements AppMenuPropertiesDe
public boolean onShowCustomView(View view) { public boolean onShowCustomView(View view) {
if (mTabManager == null) return false; if (mTabManager == null) return false;
boolean success = super.onShowCustomView(view); boolean success = super.onShowCustomView(view);
if (!CommandLine.getInstance().hasSwitch(
ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
mTabManager.setOverlayVideoMode(true); mTabManager.setOverlayVideoMode(true);
}
return success; return success;
} }
@Override @Override
public void onDestroyContentVideoView() { public void onDestroyContentVideoView() {
super.onDestroyContentVideoView(); super.onDestroyContentVideoView();
if (mTabManager != null && !CommandLine.getInstance().hasSwitch( if (mTabManager != null) {
ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
mTabManager.setOverlayVideoMode(false); mTabManager.setOverlayVideoMode(false);
} }
} }
......
...@@ -249,16 +249,13 @@ gfx::NativeView ContentVideoView::GetNativeView() { ...@@ -249,16 +249,13 @@ gfx::NativeView ContentVideoView::GetNativeView() {
JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() {
ContentViewCoreImpl* content_view_core = manager_->GetContentViewCore(); ContentViewCoreImpl* content_view_core = manager_->GetContentViewCore();
JNIEnv* env = AttachCurrentThread(); JNIEnv* env = AttachCurrentThread();
bool legacyMode = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableOverlayFullscreenVideoSubtitle);
return JavaObjectWeakGlobalRef( return JavaObjectWeakGlobalRef(
env, env,
Java_ContentVideoView_createContentVideoView( Java_ContentVideoView_createContentVideoView(
env, env,
content_view_core->GetContext().obj(), content_view_core->GetContext().obj(),
reinterpret_cast<intptr_t>(this), reinterpret_cast<intptr_t>(this),
content_view_core->GetContentVideoViewClient().obj(), content_view_core->GetContentVideoViewClient().obj()).obj());
legacyMode).obj());
} }
void ContentVideoView::CreatePowerSaveBlocker() { void ContentVideoView::CreatePowerSaveBlocker() {
...@@ -268,7 +265,6 @@ void ContentVideoView::CreatePowerSaveBlocker() { ...@@ -268,7 +265,6 @@ void ContentVideoView::CreatePowerSaveBlocker() {
// container view that was created for embedded video. The WebView cannot // container view that was created for embedded video. The WebView cannot
// reuse that so we create a new blocker instead. // reuse that so we create a new blocker instead.
if (power_save_blocker_) return; if (power_save_blocker_) return;
power_save_blocker_ = PowerSaveBlocker::Create( power_save_blocker_ = PowerSaveBlocker::Create(
PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
"Playing video").Pass(); "Playing video").Pass();
......
...@@ -171,14 +171,11 @@ void BrowserMediaPlayerManager::FullscreenPlayerSeek(int msec) { ...@@ -171,14 +171,11 @@ void BrowserMediaPlayerManager::FullscreenPlayerSeek(int msec) {
void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) {
if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) if (WebContentsDelegate* delegate = web_contents_->GetDelegate())
delegate->ToggleFullscreenModeForTab(web_contents_, false); delegate->ToggleFullscreenModeForTab(web_contents_, false);
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableOverlayFullscreenVideoSubtitle)) {
if (RenderWidgetHostViewAndroid* view_android = if (RenderWidgetHostViewAndroid* view_android =
static_cast<RenderWidgetHostViewAndroid*>( static_cast<RenderWidgetHostViewAndroid*>(
web_contents_->GetRenderWidgetHostView())) { web_contents_->GetRenderWidgetHostView())) {
view_android->SetOverlayVideoMode(false); view_android->SetOverlayVideoMode(false);
} }
}
Send( Send(
new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_));
...@@ -213,10 +210,6 @@ void BrowserMediaPlayerManager::SetVideoSurface( ...@@ -213,10 +210,6 @@ void BrowserMediaPlayerManager::SetVideoSurface(
return; return;
Send(new MediaPlayerMsg_DidEnterFullscreen(RoutingID(), player->player_id())); Send(new MediaPlayerMsg_DidEnterFullscreen(RoutingID(), player->player_id()));
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableOverlayFullscreenVideoSubtitle)) {
return;
}
if (RenderWidgetHostViewAndroid* view_android = if (RenderWidgetHostViewAndroid* view_android =
static_cast<RenderWidgetHostViewAndroid*>( static_cast<RenderWidgetHostViewAndroid*>(
web_contents_->GetRenderWidgetHostView())) { web_contents_->GetRenderWidgetHostView())) {
......
...@@ -418,21 +418,14 @@ public class ContentVideoView extends FrameLayout ...@@ -418,21 +418,14 @@ public class ContentVideoView extends FrameLayout
@CalledByNative @CalledByNative
private static ContentVideoView createContentVideoView( private static ContentVideoView createContentVideoView(
Context context, long nativeContentVideoView, ContentVideoViewClient client, Context context, long nativeContentVideoView, ContentVideoViewClient client) {
boolean legacy) {
ThreadUtils.assertOnUiThread(); ThreadUtils.assertOnUiThread();
// The context needs be Activity to create the ContentVideoView correctly. // The context needs be Activity to create the ContentVideoView correctly.
if (!isActivityContext(context)) { if (!isActivityContext(context)) {
Log.e(TAG, "Wrong type of context, can't create fullscreen video"); Log.e(TAG, "Wrong type of context, can't create fullscreen video");
return null; return null;
} }
ContentVideoView videoView = null; ContentVideoView videoView = new ContentVideoView(context, nativeContentVideoView, client);
if (legacy) {
videoView = new ContentVideoViewLegacy(context, nativeContentVideoView, client);
} else {
videoView = new ContentVideoView(context, nativeContentVideoView, client);
}
if (videoView.getContentVideoViewClient().onShowCustomView(videoView)) { if (videoView.getContentVideoViewClient().onShowCustomView(videoView)) {
return videoView; return videoView;
} }
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.content.browser;
import android.content.Context;
import android.graphics.Color;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.widget.MediaController;
/**
* Adds Android media controller to ContentVideoView.
* The sole purpose of this class is to maintain legacy behavior while we test
* the blink-based media controller.
* https://code.google.com/p/chromium/issues/detail?id=331966
*/
public class ContentVideoViewLegacy extends ContentVideoView {
private FullScreenMediaController mMediaController;
private boolean mCanPause;
private boolean mCanSeekBackward;
private boolean mCanSeekForward;
private int mCurrentBufferPercentage;
private MediaControlsVisibilityListener mListener;
/**
* A listener for changes in the MediaController visibility.
*/
public interface MediaControlsVisibilityListener {
/**
* Callback for when the visibility of the media controls changes.
*
* @param shown true if the media controls are shown to the user, false otherwise
*/
public void onMediaControlsVisibilityChanged(boolean shown);
}
private static class FullScreenMediaController extends MediaController {
final View mVideoView;
final MediaControlsVisibilityListener mListener;
/**
* @param context The context.
* @param video The full screen video container view.
* @param listener A listener that listens to the visibility of media controllers.
*/
public FullScreenMediaController(
Context context,
View video,
MediaControlsVisibilityListener listener) {
super(context);
mVideoView = video;
mListener = listener;
}
@Override
public void show() {
super.show();
if (mListener != null) mListener.onMediaControlsVisibilityChanged(true);
if (mVideoView != null) {
mVideoView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
}
@Override
public void hide() {
if (mVideoView != null) {
mVideoView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
}
if (mListener != null) mListener.onMediaControlsVisibilityChanged(false);
super.hide();
}
}
ContentVideoViewLegacy(Context context, long nativeContentVideoView,
ContentVideoViewClient client) {
super(context, nativeContentVideoView, client);
setBackgroundColor(Color.BLACK);
mCurrentBufferPercentage = 0;
}
@Override
protected void showContentVideoView() {
SurfaceView surfaceView = getSurfaceView();
surfaceView.setZOrderOnTop(true);
surfaceView.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
boolean isKeyCodeSupported = (
keyCode != KeyEvent.KEYCODE_BACK &&
keyCode != KeyEvent.KEYCODE_VOLUME_UP &&
keyCode != KeyEvent.KEYCODE_VOLUME_DOWN &&
keyCode != KeyEvent.KEYCODE_VOLUME_MUTE &&
keyCode != KeyEvent.KEYCODE_CALL &&
keyCode != KeyEvent.KEYCODE_MENU &&
keyCode != KeyEvent.KEYCODE_SEARCH &&
keyCode != KeyEvent.KEYCODE_ENDCALL);
if (isInPlaybackState() && isKeyCodeSupported && mMediaController != null) {
if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK ||
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
if (isPlaying()) {
pause();
mMediaController.show();
} else {
start();
mMediaController.hide();
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY) {
if (!isPlaying()) {
start();
mMediaController.hide();
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP
|| keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE) {
if (isPlaying()) {
pause();
mMediaController.show();
}
return true;
} else {
toggleMediaControlsVisiblity();
}
} else if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE)
&& event.getAction() == KeyEvent.ACTION_UP) {
exitFullscreen(false);
return true;
} else if (keyCode == KeyEvent.KEYCODE_MENU || keyCode == KeyEvent.KEYCODE_SEARCH) {
return true;
}
return false;
}
});
setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (isInPlaybackState() && mMediaController != null &&
event.getAction() == MotionEvent.ACTION_DOWN) {
toggleMediaControlsVisiblity();
}
return true;
}
});
surfaceView.setFocusable(true);
surfaceView.setFocusableInTouchMode(true);
surfaceView.requestFocus();
super.showContentVideoView();
}
@Override
public void onMediaPlayerError(int errorType) {
super.onMediaPlayerError(errorType);
if (errorType == MEDIA_ERROR_INVALID_CODE) return;
if (mMediaController != null) mMediaController.hide();
}
@Override
protected void onBufferingUpdate(int percent) {
super.onBufferingUpdate(percent);
mCurrentBufferPercentage = percent;
}
@Override
protected void onUpdateMediaMetadata(
int videoWidth,
int videoHeight,
int duration,
boolean canPause,
boolean canSeekBack,
boolean canSeekForward) {
super.onUpdateMediaMetadata(videoWidth, videoHeight, duration,
canPause, canSeekBack, canSeekForward);
mCanPause = canPause;
mCanSeekBackward = canSeekBack;
mCanSeekForward = canSeekForward;
if (mMediaController == null) return;
mMediaController.setEnabled(true);
// If paused , should show the controller forever.
if (isPlaying()) {
mMediaController.show();
} else {
mMediaController.show(0);
}
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
super.surfaceChanged(holder, format, width, height);
SurfaceView surfaceView = getSurfaceView();
surfaceView.setFocusable(true);
surfaceView.setFocusableInTouchMode(true);
if (isInPlaybackState() && mMediaController != null) {
mMediaController.show();
}
}
@Override
protected void openVideo() {
super.openVideo();
mCurrentBufferPercentage = 0;
if (mMediaController != null) return;
mMediaController = new FullScreenMediaController(getContext(), this, mListener);
mMediaController.setMediaPlayer(new MediaController.MediaPlayerControl() {
@Override public boolean canPause() { return mCanPause; }
@Override public boolean canSeekBackward() { return mCanSeekBackward; }
@Override public boolean canSeekForward() { return mCanSeekForward; }
@Override public int getAudioSessionId() { return 0; }
@Override public int getBufferPercentage() { return mCurrentBufferPercentage; }
@Override
public int getCurrentPosition() {
return ContentVideoViewLegacy.this.getCurrentPosition();
}
@Override
public int getDuration() {
return ContentVideoViewLegacy.this.getDuration();
}
@Override
public boolean isPlaying() {
return ContentVideoViewLegacy.this.isPlaying();
}
@Override
public void pause() {
ContentVideoViewLegacy.this.pause();
}
@Override
public void seekTo(int pos) {
ContentVideoViewLegacy.this.seekTo(pos);
}
@Override
public void start() {
ContentVideoViewLegacy.this.start();
}
});
mMediaController.setAnchorView(getSurfaceView());
mMediaController.setEnabled(false);
}
@Override
protected void onCompletion() {
super.onCompletion();
if (mMediaController != null) {
mMediaController.hide();
}
}
@Override
public boolean onTrackballEvent(MotionEvent ev) {
if (isInPlaybackState() && mMediaController != null) {
toggleMediaControlsVisiblity();
}
return false;
}
private void toggleMediaControlsVisiblity() {
if (mMediaController.isShowing()) {
mMediaController.hide();
} else {
mMediaController.show();
}
}
@Override
protected void destroyContentVideoView(boolean nativeViewDestroyed) {
if (mMediaController != null) {
mMediaController.setEnabled(false);
mMediaController.hide();
mMediaController = null;
}
super.destroyContentVideoView(nativeViewDestroyed);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
return true;
}
/**
* Sets the MediaControlsVisibilityListener that wants to listen to visibility change events.
*
* @param listener the listener to send the events to.
*/
public void setListener(MediaControlsVisibilityListener listener) {
mListener = listener;
}
}
...@@ -70,10 +70,6 @@ public abstract class ContentSwitches { ...@@ -70,10 +70,6 @@ public abstract class ContentSwitches {
// Native switch - chrome_switches::kDisablePopupBlocking // Native switch - chrome_switches::kDisablePopupBlocking
public static final String DISABLE_POPUP_BLOCKING = "disable-popup-blocking"; public static final String DISABLE_POPUP_BLOCKING = "disable-popup-blocking";
// Native switch - content_switches::kDisableOverlayFullscreenVideoSubtitle
public static final String DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE =
"disable-overlay-fullscreen-video-subtitle";
// Native switch - gfx_switches::kForceDeviceScaleFactor // Native switch - gfx_switches::kForceDeviceScaleFactor
public static final String FORCE_DEVICE_SCALE_FACTOR = public static final String FORCE_DEVICE_SCALE_FACTOR =
"force-device-scale-factor"; "force-device-scale-factor";
......
...@@ -380,10 +380,6 @@ const char kEnableOneCopy[] = "enable-one-copy"; ...@@ -380,10 +380,6 @@ const char kEnableOneCopy[] = "enable-one-copy";
// Enables use of hardware overlay for fullscreen video playback. Android only. // Enables use of hardware overlay for fullscreen video playback. Android only.
const char kEnableOverlayFullscreenVideo[] = "enable-overlay-fullscreen-video"; const char kEnableOverlayFullscreenVideo[] = "enable-overlay-fullscreen-video";
// Disables blink subtitle and media control on top of overlay fullscreen video.
const char kDisableOverlayFullscreenVideoSubtitle[] =
"disable-overlay-fullscreen-video-subtitle";
// Forward overscroll event data from the renderer to the browser. // Forward overscroll event data from the renderer to the browser.
const char kEnableOverscrollNotifications[] = "enable-overscroll-notifications"; const char kEnableOverscrollNotifications[] = "enable-overscroll-notifications";
......
...@@ -116,7 +116,6 @@ extern const char kEnableMemoryBenchmarking[]; ...@@ -116,7 +116,6 @@ extern const char kEnableMemoryBenchmarking[];
CONTENT_EXPORT extern const char kEnableNetworkInformation[]; CONTENT_EXPORT extern const char kEnableNetworkInformation[];
CONTENT_EXPORT extern const char kEnableOneCopy[]; CONTENT_EXPORT extern const char kEnableOneCopy[];
CONTENT_EXPORT extern const char kEnableOverlayFullscreenVideo[]; CONTENT_EXPORT extern const char kEnableOverlayFullscreenVideo[];
CONTENT_EXPORT extern const char kDisableOverlayFullscreenVideoSubtitle[];
CONTENT_EXPORT extern const char kEnableOverscrollNotifications[]; CONTENT_EXPORT extern const char kEnableOverscrollNotifications[];
CONTENT_EXPORT extern const char kEnablePinch[]; CONTENT_EXPORT extern const char kEnablePinch[];
CONTENT_EXPORT extern const char kEnablePreciseMemoryInfo[]; CONTENT_EXPORT extern const char kEnablePreciseMemoryInfo[];
......
...@@ -12,7 +12,6 @@ import android.view.View; ...@@ -12,7 +12,6 @@ import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import org.chromium.base.CalledByNative; import org.chromium.base.CalledByNative;
import org.chromium.base.CommandLine;
import org.chromium.base.JNINamespace; import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.content.browser.ActivityContentVideoViewClient; import org.chromium.content.browser.ActivityContentVideoViewClient;
...@@ -20,7 +19,6 @@ import org.chromium.content.browser.ContentVideoViewClient; ...@@ -20,7 +19,6 @@ import org.chromium.content.browser.ContentVideoViewClient;
import org.chromium.content.browser.ContentViewClient; import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.ContentViewRenderView; import org.chromium.content.browser.ContentViewRenderView;
import org.chromium.content.common.ContentSwitches;
import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.base.WindowAndroid;
/** /**
...@@ -53,21 +51,15 @@ public class ShellManager extends FrameLayout { ...@@ -53,21 +51,15 @@ public class ShellManager extends FrameLayout {
@Override @Override
public boolean onShowCustomView(View view) { public boolean onShowCustomView(View view) {
boolean success = super.onShowCustomView(view); boolean success = super.onShowCustomView(view);
if (!CommandLine.getInstance().hasSwitch(
ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
setOverlayVideoMode(true); setOverlayVideoMode(true);
}
return success; return success;
} }
@Override @Override
public void onDestroyContentVideoView() { public void onDestroyContentVideoView() {
super.onDestroyContentVideoView(); super.onDestroyContentVideoView();
if (!CommandLine.getInstance().hasSwitch(
ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
setOverlayVideoMode(false); setOverlayVideoMode(false);
} }
}
}; };
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment