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

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: rebased 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 9d501fcfd8b7324f41eaf052962620b96e4c43fb..3f89cfec433a60bce46f24b332e5b47eb6a690f5 100644
--- a/content/browser/media/session/media_session.h
+++ b/content/browser/media/session/media_session.h
@@ -63,6 +63,8 @@ class MediaSession : public WebContentsObserver,
~MediaSession() override;
+ void WasShown() override;
mlamouri (slow - plz ping) 2016/09/05 09:40:36 To simplify understanding this, can you explain wh
Zhiqiang Zhang (Slow) 2016/09/05 09:54:21 Oh, it seems like the code when I was doing experi
+
void SetMetadata(const MediaMetadata& metadata);
const MediaMetadata& metadata() const { return metadata_; }
@@ -111,6 +113,8 @@ class MediaSession : public WebContentsObserver,
// recovered.
CONTENT_EXPORT void StopDucking();
+ CONTENT_EXPORT bool IsDucking() { return is_ducking_; }
+
// Returns if the session can be controlled by Resume() and Suspend calls
// above.
CONTENT_EXPORT bool IsControllable() const;
@@ -128,6 +132,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);
mlamouri (slow - plz ping) 2016/09/05 09:40:36 ditto, what's `SetOnTop` for?
Zhiqiang Zhang (Slow) 2016/09/05 09:54:21 I discussed this with Anton, and the method is act
+
private:
friend class content::WebContentsUserData<MediaSession>;
friend class ::MediaSessionBrowserTest;
@@ -198,14 +204,19 @@ class MediaSession : public WebContentsObserver,
// Get the volume multiplier, which depends on whether the media session is
// ducking.
double GetVolumeMultiplier() const;
+ double GetPepperVolumeMultiplier() const;
// Registers a MediaSession state change callback.
CONTENT_EXPORT std::unique_ptr<base::CallbackList<void(State)>::Subscription>
RegisterMediaSessionStateChangedCallbackForTest(
const StateChangedCallback& cb);
+ CONTENT_EXPORT bool AddPepperPlayer(MediaSessionObserver* observer,
+ int player_id);
+
std::unique_ptr<MediaSessionDelegate> delegate_;
PlayersMap players_;
+ PlayersMap pepper_players_;
State audio_focus_state_;
SuspendType suspend_type_;
@@ -217,6 +228,7 @@ class MediaSession : public WebContentsObserver,
// is set to |true| after StartDucking(), and will be set to |false| after
// StopDucking().
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