Index: content/browser/android/content_video_view.cc |
diff --git a/content/browser/android/content_video_view.cc b/content/browser/android/content_video_view.cc |
index 9edadb4bf685d6903e18babd77a52d77ba236bae..85f5719954fd4d50f77f1e02d70a0a408959ef5c 100644 |
--- a/content/browser/android/content_video_view.cc |
+++ b/content/browser/android/content_video_view.cc |
@@ -97,7 +97,12 @@ void ContentVideoView::OnPlaybackComplete() { |
} |
void ContentVideoView::OnExitFullscreen() { |
- DestroyContentVideoView(false); |
+ JNIEnv *env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> content_video_view = GetJavaObject(env); |
+ if (!content_video_view.is_null()) { |
+ Java_ContentVideoView_onExitFullscreen(env, content_video_view.obj()); |
+ j_content_video_view_.reset(); |
+ } |
} |
void ContentVideoView::UpdateMediaMetadata() { |
@@ -145,7 +150,7 @@ void ContentVideoView::Pause(JNIEnv*, jobject obj) { |
} |
void ContentVideoView::ExitFullscreen( |
- JNIEnv* env, jobject, jboolean release_media_player) { |
+ JNIEnv*, jobject, jboolean release_media_player) { |
if (fullscreen_state_ == SUSPENDED) |
return; |
j_content_video_view_.reset(); |
@@ -198,13 +203,16 @@ ScopedJavaLocalRef<jobject> ContentVideoView::GetJavaObject(JNIEnv* env) { |
JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { |
ContentViewCoreImpl* content_view_core = manager_->GetContentViewCore(); |
JNIEnv *env = AttachCurrentThread(); |
+ bool legacyMode = !CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableOverlayFullscreenVideoSubtitle); |
return JavaObjectWeakGlobalRef( |
env, |
Java_ContentVideoView_createContentVideoView( |
env, |
content_view_core->GetContext().obj(), |
reinterpret_cast<intptr_t>(this), |
- content_view_core->GetContentVideoViewClient().obj()).obj()); |
+ content_view_core->GetContentVideoViewClient().obj(), |
+ legacyMode).obj()); |
} |
void ContentVideoView::DestroyContentVideoView(bool native_view_destroyed) { |