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

Unified Diff: content/browser/android/content_video_view.cc

Issue 25040002: Enables fullscreen subtitle and media control from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@build_hack
Patch Set: rebased, let's go! Created 6 years, 11 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
« no previous file with comments | « no previous file | content/browser/android/content_view_render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | content/browser/android/content_view_render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698