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

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

Issue 1243683003: Android MediaSession: do not resume a UI suspended session on a system resume. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 5 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
« no previous file with comments | « no previous file | content/browser/media/android/media_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3cd5dffb4752e37311f1656eb4ac8c65d51178f6 100644
--- a/content/browser/media/android/media_session.h
+++ b/content/browser/media/android/media_session.h
@@ -93,13 +93,17 @@ class CONTENT_EXPORT MediaSession
Type audio_focus_type_for_test() const;
void RemoveAllPlayersForTest();
- void OnSuspendInternal(bool temporary);
- void OnResumeInternal();
-
enum class State {
- Active,
- TemporarilySuspended,
- Suspended,
+ ACTIVE,
+ SUSPENDED,
+ INACTIVE
+ };
+
+ enum class SuspendType {
+ // Suspended by the system because a transient sound needs to be played.
+ SYSTEM,
+ // Suspended by the UI.
+ UI,
};
// Representation of a player for the MediaSession.
@@ -125,6 +129,9 @@ class CONTENT_EXPORT MediaSession
// Setup the JNI.
void Initialize();
+ void OnSuspendInternal(SuspendType type);
+ void OnResumeInternal(SuspendType type);
+
// Requests audio focus to Android using |j_media_session_|.
// Returns whether the request was granted. If |j_media_session_| is null, it
// will always return true.
@@ -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);
« no previous file with comments | « no previous file | content/browser/media/android/media_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698