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() { |