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

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

Issue 1996043002: Split MediaContentType and AudioFocusType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits 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 044a2676600f4dc619a134b4da19501692f96d41..d791c61eacc54dde1bfc4437a7223ad0be8f1638 100644
--- a/content/browser/media/session/media_session.h
+++ b/content/browser/media/session/media_session.h
@@ -10,6 +10,7 @@
#include "base/callback_list.h"
#include "base/id_map.h"
#include "base/macros.h"
+#include "content/browser/media/session/audio_focus_manager.h"
#include "content/browser/media/session/media_session_uma_helper.h"
#include "content/common/content_export.h"
#include "content/public/browser/web_contents_observer.h"
@@ -18,6 +19,10 @@
class MediaSessionBrowserTest;
+namespace media {
+enum class MediaContentType;
+} // namespace media
+
namespace content {
class AudioFocusManagerTest;
@@ -43,11 +48,6 @@ class MediaSessionVisibilityBrowserTest;
class MediaSession : public WebContentsObserver,
protected WebContentsUserData<MediaSession> {
public:
- enum class Type {
- Content,
- Transient
- };
-
enum class SuspendType {
// Suspended by the system because a transient sound needs to be played.
SYSTEM,
@@ -70,7 +70,8 @@ class MediaSession : public WebContentsObserver,
// player was successfully added. If it returns false, AddPlayer() should be
// called again later.
CONTENT_EXPORT bool AddPlayer(MediaSessionObserver* observer,
- int player_id, Type type);
+ int player_id,
+ media::MediaContentType media_content_type);
// Removes the given player from the current media session. Abandons audio
// focus if that was the last player in the session.
@@ -92,15 +93,15 @@ class MediaSession : public WebContentsObserver,
// Resume the media session.
// |type| represents the origin of the request.
- CONTENT_EXPORT void Resume(SuspendType type);
+ CONTENT_EXPORT void Resume(SuspendType suspend_type);
// Suspend the media session.
// |type| represents the origin of the request.
- CONTENT_EXPORT void Suspend(SuspendType type);
+ CONTENT_EXPORT void Suspend(SuspendType suspend_type);
// Stop the media session.
// |type| represents the origin of the request.
- CONTENT_EXPORT void Stop(SuspendType type);
+ CONTENT_EXPORT void Stop(SuspendType suspend_type);
// Change the volume multiplier of the session to |volume_multiplier|.
CONTENT_EXPORT void SetVolumeMultiplier(double volume_multiplier);
@@ -132,7 +133,8 @@ class MediaSession : public WebContentsObserver,
CONTENT_EXPORT void SetDelegateForTests(
std::unique_ptr<MediaSessionDelegate> delegate);
CONTENT_EXPORT bool IsActiveForTest() const;
- CONTENT_EXPORT Type audio_focus_type_for_test() const;
+ CONTENT_EXPORT AudioFocusManager::AudioFocusType audio_focus_type_for_test()
+ const;
CONTENT_EXPORT void RemoveAllPlayersForTest();
CONTENT_EXPORT MediaSessionUmaHelper* uma_helper_for_test();
@@ -165,12 +167,14 @@ class MediaSession : public WebContentsObserver,
void Initialize();
- CONTENT_EXPORT void OnSuspendInternal(SuspendType type, State new_state);
- CONTENT_EXPORT void OnResumeInternal(SuspendType type);
+ CONTENT_EXPORT void OnSuspendInternal(SuspendType suspend_type,
+ State new_state);
+ CONTENT_EXPORT void OnResumeInternal(SuspendType suspend_type);
// Requests audio focus to the MediaSessionDelegate.
// Returns whether the request was granted.
- bool RequestSystemAudioFocus(Type type);
+ bool RequestSystemAudioFocus(
+ AudioFocusManager::AudioFocusType audio_focus_type);
// To be called after a call to AbandonAudioFocus() in order request the
// delegate to abandon the audio focus.
@@ -193,7 +197,7 @@ class MediaSession : public WebContentsObserver,
State audio_focus_state_;
SuspendType suspend_type_;
- Type audio_focus_type_;
+ AudioFocusManager::AudioFocusType audio_focus_type_;
MediaSessionUmaHelper uma_helper_;
« no previous file with comments | « content/browser/media/media_web_contents_observer.cc ('k') | content/browser/media/session/media_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698