Chromium Code Reviews| Index: content/browser/media/android/media_session.h |
| diff --git a/content/browser/media/android/media_session.h b/content/browser/media/android/media_session.h |
| index 55e430bb418149fe1a2f674c55696f8ce0214ac5..87e5397bab37d6879464132caf5479e7486b3d13 100644 |
| --- a/content/browser/media/android/media_session.h |
| +++ b/content/browser/media/android/media_session.h |
| @@ -38,6 +38,13 @@ class CONTENT_EXPORT MediaSession |
| Transient |
| }; |
| + enum class SuspendType { |
| + // Suspended by the system because a transient sound needs to be played. |
| + System, |
|
qinmin
2015/07/21 22:58:17
s/System/SYSTEM/
|
| + // Suspended by the UI. |
| + UI, |
| + }; |
| + |
| static bool RegisterMediaSession(JNIEnv* env); |
| // Returns the MediaSession associated to this WebContents. Creates one if |
| @@ -69,11 +76,11 @@ class CONTENT_EXPORT MediaSession |
| // Called when the user requests resuming the session. No-op if the session is |
| // not controllable. |
| - void Resume(); |
| + void Resume(SuspendType type); |
| // Called when the user requests suspending the session. No-op if the session |
| // is not controllable. |
| - void Suspend(); |
| + void Suspend(SuspendType type); |
| // Returns if the session can be controlled by Resume() and Suspend calls |
| // above. |
| @@ -93,13 +100,13 @@ class CONTENT_EXPORT MediaSession |
| Type audio_focus_type_for_test() const; |
| void RemoveAllPlayersForTest(); |
| - void OnSuspendInternal(bool temporary); |
| - void OnResumeInternal(); |
| + void OnSuspendInternal(SuspendType type); |
| + void OnResumeInternal(SuspendType type); |
| enum class State { |
| Active, |
|
qinmin
2015/07/21 22:58:17
change all the enum names here
ACTIVE, SUSPENDED,
|
| - TemporarilySuspended, |
| Suspended, |
| + Inactive |
| }; |
| // Representation of a player for the MediaSession. |
| @@ -141,6 +148,7 @@ class CONTENT_EXPORT MediaSession |
| PlayersMap players_; |
| State audio_focus_state_; |
| + SuspendType suspend_type_; |
| Type audio_focus_type_; |
| DISALLOW_COPY_AND_ASSIGN(MediaSession); |