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

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: rebased 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
« no previous file with comments | « content/browser/android/content_video_view.h ('k') | content/browser/android/content_view_core_impl.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 12020bee8198e57d9bf97d5932f486317a81daac..0e6e090427b97234de80f90e11d0feb343b12b79 100644
--- a/content/browser/android/content_video_view.cc
+++ b/content/browser/android/content_video_view.cc
@@ -45,7 +45,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();
@@ -171,42 +170,14 @@ void ContentVideoView::Pause(JNIEnv*, jobject obj) {
void ContentVideoView::ExitFullscreen(
JNIEnv*, jobject, jboolean release_media_player) {
power_save_blocker_.reset();
- if (fullscreen_state_ == SUSPENDED)
- return;
j_content_video_view_.reset();
manager_->ExitFullscreen(release_media_player);
}
-void ContentVideoView::SuspendFullscreen() {
- power_save_blocker_.reset();
- 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();
- CreatePowerSaveBlocker();
-}
-
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) {
« no previous file with comments | « content/browser/android/content_video_view.h ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698