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

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

Issue 157783004: Partial revert of "Restart fullscreen video playback when switching back from background" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/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 af3067a2094b4d2dc014125e7bd987948fa25dd1..d774a4e5dc5af3955d1bf488965b48e94aef1cfb 100644
--- a/content/browser/android/content_video_view.cc
+++ b/content/browser/android/content_video_view.cc
@@ -44,7 +44,6 @@ ContentVideoView* ContentVideoView::GetInstance() {
ContentVideoView::ContentVideoView(
BrowserMediaPlayerManager* manager)
: manager_(manager),
- fullscreen_state_(ENTERED),
weak_factory_(this) {
DCHECK(!g_content_video_view);
j_content_video_view_ = CreateJavaObject();
@@ -161,40 +160,14 @@ void ContentVideoView::Pause(JNIEnv*, jobject obj) {
void ContentVideoView::ExitFullscreen(
JNIEnv*, jobject, jboolean release_media_player) {
- if (fullscreen_state_ == SUSPENDED)
- return;
j_content_video_view_.reset();
manager_->ExitFullscreen(release_media_player);
}
-void ContentVideoView::SuspendFullscreen() {
- if (fullscreen_state_ != ENTERED)
- return;
- fullscreen_state_ = SUSPENDED;
- DestroyContentVideoView(false);
- manager_->SuspendFullscreen();
-}
-
-void ContentVideoView::ResumeFullscreenIfSuspended() {
- if (fullscreen_state_ != SUSPENDED)
- return;
- JNIEnv* env = AttachCurrentThread();
- DCHECK(!GetJavaObject(env).obj());
- fullscreen_state_ = RESUME;
- j_content_video_view_ = CreateJavaObject();
-}
-
void ContentVideoView::SetSurface(JNIEnv* env, jobject obj,
jobject surface) {
- gfx::ScopedJavaSurface scoped_surface =
- gfx::ScopedJavaSurface::AcquireExternalSurface(surface);
- if (fullscreen_state_ == RESUME) {
- DCHECK(surface);
- manager_->ResumeFullscreen(scoped_surface.Pass());
- fullscreen_state_ = ENTERED;
- } else {
- manager_->SetVideoSurface(scoped_surface.Pass());
- }
+ manager_->SetVideoSurface(
+ gfx::ScopedJavaSurface::AcquireExternalSurface(surface));
}
void ContentVideoView::RequestMediaMetadata(JNIEnv* env, jobject obj) {

Powered by Google App Engine
This is Rietveld 408576698