summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authortrchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 02:16:00 +0000
committertrchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 02:16:00 +0000
commitd66ddadb9cb422d7bf73b07a0b54b5710aed3710 (patch)
tree151bccc7ce2888b632ed043e02d5d48f3c96a659 /content/shell
parentce6b6d67f72e351126f70513b0d0170bbba3be99 (diff)
downloadchromium_src-d66ddadb9cb422d7bf73b07a0b54b5710aed3710.zip
chromium_src-d66ddadb9cb422d7bf73b07a0b54b5710aed3710.tar.gz
chromium_src-d66ddadb9cb422d7bf73b07a0b54b5710aed3710.tar.bz2
Enables fullscreen subtitle and media control from Blink
In detail, this patch does the following things: - Move the Blink SurfaceView on top of ContentVideoView - Enable necessary bits on the compositor to make background transparent, and enables alpha blending. - Introduce a new command-line flag to enable the new mode. The old-style Java media control are moved to ContentVideoViewLegacy, which is enabled by default. To enable the blink-based media control, do the following: adb shell sudo echo chrome --enable-overlay-fullscreen-video-subtitle > /data/local/chrome-command-line R= BUG=262945 Review URL: https://codereview.chromium.org/25040002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/android/java/src/org/chromium/content_shell/ShellManager.java9
-rw-r--r--content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java15
2 files changed, 23 insertions, 1 deletions
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
index aad1197..c1f1e3d 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
@@ -85,6 +85,15 @@ public class ShellManager extends FrameLayout {
nativeLaunchShell(url);
}
+ /**
+ * Enter or leave overlay video mode.
+ * @param enabled Whether overlay mode is enabled.
+ */
+ public void setOverlayVideoMode(boolean enabled) {
+ if (mContentViewRenderView == null) return;
+ mContentViewRenderView.setOverlayVideoMode(enabled);
+ }
+
@SuppressWarnings("unused")
@CalledByNative
private Object createShell() {
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
index e055d7b..505ae86 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
@@ -10,6 +10,7 @@ import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
+import android.view.View;
import android.widget.Toast;
import org.chromium.base.BaseSwitches;
@@ -118,7 +119,19 @@ public class ContentShellActivity extends Activity {
getActiveContentView().setContentViewClient(new ContentViewClient() {
@Override
public ContentVideoViewClient getContentVideoViewClient() {
- return new ActivityContentVideoViewClient(ContentShellActivity.this);
+ return new ActivityContentVideoViewClient(ContentShellActivity.this) {
+ @Override
+ public void onShowCustomView(View view) {
+ super.onShowCustomView(view);
+ mShellManager.setOverlayVideoMode(true);
+ }
+
+ @Override
+ public void onDestroyContentVideoView() {
+ super.onDestroyContentVideoView();
+ mShellManager.setOverlayVideoMode(false);
+ }
+ };
}
});
}