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

Unified Diff: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java

Issue 172043002: Fix a crash of the Content Shell for Android when showing videos in a ContentVideoView. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 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: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
===================================================================
--- content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java (revision 251875)
+++ content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java (working copy)
@@ -74,7 +74,31 @@
mWindowAndroid = new ActivityWindowAndroid(this);
mWindowAndroid.restoreInstanceState(savedInstanceState);
mShellManager.setWindow(mWindowAndroid);
+ mShellManager.setContentViewClient(new ContentViewClient() {
+ @Override
+ public ContentVideoViewClient getContentVideoViewClient() {
+ return new ActivityContentVideoViewClient(ContentShellActivity.this) {
+ @Override
+ public void onShowCustomView(View view) {
+ super.onShowCustomView(view);
+ if (CommandLine.getInstance().hasSwitch(
+ ContentSwitches.ENABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
+ mShellManager.setOverlayVideoMode(true);
+ }
+ }
+ @Override
+ public void onDestroyContentVideoView() {
+ super.onDestroyContentVideoView();
+ if (CommandLine.getInstance().hasSwitch(
+ ContentSwitches.ENABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
+ mShellManager.setOverlayVideoMode(false);
+ }
+ }
+ };
+ }
+ });
+
String startupUrl = getUrlFromIntent(getIntent());
if (!TextUtils.isEmpty(startupUrl)) {
mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
@@ -116,30 +140,6 @@
shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
}
mShellManager.launchShell(shellUrl);
- getActiveContentView().setContentViewClient(new ContentViewClient() {
- @Override
- public ContentVideoViewClient getContentVideoViewClient() {
- return new ActivityContentVideoViewClient(ContentShellActivity.this) {
- @Override
- public void onShowCustomView(View view) {
- super.onShowCustomView(view);
- if (CommandLine.getInstance().hasSwitch(
- ContentSwitches.ENABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
- mShellManager.setOverlayVideoMode(true);
- }
- }
-
- @Override
- public void onDestroyContentVideoView() {
- super.onDestroyContentVideoView();
- if (CommandLine.getInstance().hasSwitch(
- ContentSwitches.ENABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
- mShellManager.setOverlayVideoMode(false);
- }
- }
- };
- }
- });
}
private void initializationFailed() {

Powered by Google App Engine
This is Rietveld 408576698