Commit 0526d569 authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Switched power status helper to use "effectively fullscreen".

We'd like to know "is user watching video" vs "is user scrolling
around the page" when recording power.  So, we allow any
fullscreen-like experience to count, rather than just strictly
full-screening the media element.

While this is still not exact, it's much closer to what we want.

Bug: 1017787
Change-Id: Idb022eb10a9f5e51f0fdef58c3a11ab5e9f40849
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2070836Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745261}
parent 4192f33e
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/base/data_url.h" #include "net/base/data_url.h"
#include "third_party/blink/public/platform/web_encrypted_media_types.h" #include "third_party/blink/public/platform/web_encrypted_media_types.h"
#include "third_party/blink/public/platform/web_fullscreen_video_status.h"
#include "third_party/blink/public/platform/web_media_player_client.h" #include "third_party/blink/public/platform/web_media_player_client.h"
#include "third_party/blink/public/platform/web_media_player_encrypted_media_client.h" #include "third_party/blink/public/platform/web_media_player_encrypted_media_client.h"
#include "third_party/blink/public/platform/web_media_player_source.h" #include "third_party/blink/public/platform/web_media_player_source.h"
...@@ -569,15 +570,9 @@ void WebMediaPlayerImpl::EnteredFullscreen() { ...@@ -569,15 +570,9 @@ void WebMediaPlayerImpl::EnteredFullscreen() {
// info before returning. // info before returning.
if (!decoder_requires_restart_for_overlay_) if (!decoder_requires_restart_for_overlay_)
MaybeSendOverlayInfoToDecoder(); MaybeSendOverlayInfoToDecoder();
if (power_status_helper_)
power_status_helper_->SetIsFullscreen(true);
} }
void WebMediaPlayerImpl::ExitedFullscreen() { void WebMediaPlayerImpl::ExitedFullscreen() {
if (power_status_helper_)
power_status_helper_->SetIsFullscreen(false);
overlay_info_.is_fullscreen = false; overlay_info_.is_fullscreen = false;
// If we're in overlay mode, then exit it unless we're supposed to allow // If we're in overlay mode, then exit it unless we're supposed to allow
...@@ -598,6 +593,14 @@ void WebMediaPlayerImpl::BecameDominantVisibleContent(bool is_dominant) { ...@@ -598,6 +593,14 @@ void WebMediaPlayerImpl::BecameDominantVisibleContent(bool is_dominant) {
void WebMediaPlayerImpl::SetIsEffectivelyFullscreen( void WebMediaPlayerImpl::SetIsEffectivelyFullscreen(
blink::WebFullscreenVideoStatus fullscreen_video_status) { blink::WebFullscreenVideoStatus fullscreen_video_status) {
delegate_->SetIsEffectivelyFullscreen(delegate_id_, fullscreen_video_status); delegate_->SetIsEffectivelyFullscreen(delegate_id_, fullscreen_video_status);
if (power_status_helper_) {
// We don't care about pip, so anything that's "not fullscreen" is good
// enough for us.
power_status_helper_->SetIsFullscreen(
fullscreen_video_status !=
blink::WebFullscreenVideoStatus::kNotEffectivelyFullscreen);
}
} }
void WebMediaPlayerImpl::OnHasNativeControlsChanged(bool has_native_controls) { void WebMediaPlayerImpl::OnHasNativeControlsChanged(bool has_native_controls) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment