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

Unified Diff: content/browser/media/media_web_contents_observer.h

Issue 2693203002: Provide a WebContents API to discover the playback of a fullscreen video. (Closed)
Patch Set: review comments and compile fix Created 3 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/media/media_web_contents_observer.h
diff --git a/content/browser/media/media_web_contents_observer.h b/content/browser/media/media_web_contents_observer.h
index 5d6d8d2f5ff92d2f54f53bafcd1e03aa7642cab7..a4ce3a657cb9aed4f2e26f4686f3ae28def2c600 100644
--- a/content/browser/media/media_web_contents_observer.h
+++ b/content/browser/media/media_web_contents_observer.h
@@ -42,6 +42,13 @@ class CONTENT_EXPORT MediaWebContentsObserver : public WebContentsObserver {
// Called by WebContentsImpl when the audible state may have changed.
void MaybeUpdateAudibleState();
+ // Called by WebContentsImpl to know if an active player is effectively
+ // fullscreen. That means that the video is either fullscreen or it is the
+ // content of a fullscreen page (in other words, a fullscreen video with
+ // custom controls).
+ // It should only be called while the WebContents is fullscreen.
+ bool HasActiveEffectivelyFullscreenVideo() const;
+
// WebContentsObserver implementation.
void WebContentsDestroyed() override;
void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
@@ -74,6 +81,9 @@ class CONTENT_EXPORT MediaWebContentsObserver : public WebContentsObserver {
bool has_audio,
bool is_remote,
media::MediaContentType media_content_type);
+ void OnMediaEffectivelyFullscreenChange(RenderFrameHost* render_frame_host,
+ int delegate_id,
+ bool is_fullscreen);
// Clear |render_frame_host|'s tracking entry for its power save blockers.
void ClearPowerSaveBlockers(RenderFrameHost* render_frame_host);
@@ -106,6 +116,7 @@ class CONTENT_EXPORT MediaWebContentsObserver : public WebContentsObserver {
ActiveMediaPlayerMap active_video_players_;
std::unique_ptr<device::PowerSaveBlocker> audio_power_save_blocker_;
std::unique_ptr<device::PowerSaveBlocker> video_power_save_blocker_;
+ base::Optional<MediaPlayerId> fullscreen_player_;
MediaSessionControllersManager session_controllers_manager_;

Powered by Google App Engine
This is Rietveld 408576698