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

Unified Diff: content/browser/media/session/media_session.h

Issue 2274873003: Letting Flash join MediaSession (stack implementaion) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_session_type
Patch Set: fixed unduck bug Created 4 years, 4 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/session/media_session.h
diff --git a/content/browser/media/session/media_session.h b/content/browser/media/session/media_session.h
index d791c61eacc54dde1bfc4437a7223ad0be8f1638..832e95cf8bb9596cb68908e2135a759a3c3106b1 100644
--- a/content/browser/media/session/media_session.h
+++ b/content/browser/media/session/media_session.h
@@ -103,8 +103,10 @@ class MediaSession : public WebContentsObserver,
// |type| represents the origin of the request.
CONTENT_EXPORT void Stop(SuspendType suspend_type);
- // Change the volume multiplier of the session to |volume_multiplier|.
- CONTENT_EXPORT void SetVolumeMultiplier(double volume_multiplier);
+ CONTENT_EXPORT void Duck();
+ CONTENT_EXPORT void Unduck();
+
+ CONTENT_EXPORT bool IsDucking() { return is_ducking_; }
// Returns if the session can be controlled by Resume() and Suspend calls
// above.
@@ -123,6 +125,8 @@ class MediaSession : public WebContentsObserver,
// Returns if the session is currently suspended or inactive.
CONTENT_EXPORT bool IsSuspended() const;
+ void SetOnTop(bool is_on_top);
+
private:
friend class content::WebContentsUserData<MediaSession>;
friend class ::MediaSessionBrowserTest;
@@ -192,8 +196,15 @@ class MediaSession : public WebContentsObserver,
RegisterMediaSessionStateChangedCallbackForTest(
const StateChangedCallback& cb);
+ CONTENT_EXPORT bool AddPepperPlayer(MediaSessionObserver* observer,
+ int player_id);
+
+ double GetVolumeMultiplier() const;
+ double GetPepperVolumeMultiplier() const;
+
std::unique_ptr<MediaSessionDelegate> delegate_;
PlayersMap players_;
+ PlayersMap pepper_players_;
State audio_focus_state_;
SuspendType suspend_type_;
@@ -201,9 +212,12 @@ class MediaSession : public WebContentsObserver,
MediaSessionUmaHelper uma_helper_;
- // The volume multiplier of this session. All players in this session should
- // multiply their volume with this multiplier to get the effective volume.
- double volume_multiplier_;
+ // Whether this session is ducked, which is used to compute the volume
+ // multiplier of this session. All players in this session should multiply
+ // their volume with this multiplier to get the effective volume.
+ bool is_ducking_;
+
+ bool is_on_top_;
MediaMetadata metadata_;
base::CallbackList<void(State)> media_session_state_listeners_;

Powered by Google App Engine
This is Rietveld 408576698