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

Side by Side Diff: content/public/browser/media_session.h

Issue 2623953002: [Chromecast] Fix media session blocking tests. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_
6 #define CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ 6 #define CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 10
11 namespace blink { 11 namespace blink {
12 namespace mojom { 12 namespace mojom {
13 enum class MediaSessionAction; 13 enum class MediaSessionAction;
14 } // namespace mojom 14 } // namespace mojom
15 } // namespace blink 15 } // namespace blink
16 16
17 namespace content { 17 namespace content {
18 18
19 class MediaSessionObserver;
19 class WebContents; 20 class WebContents;
20 21
21 // MediaSession manages the media session and audio focus for a given 22 // MediaSession manages the media session and audio focus for a given
22 // WebContents. There is only one MediaSession per WebContents. 23 // WebContents. There is only one MediaSession per WebContents.
23 // 24 //
24 // MediaSession allows clients to observe its changes via MediaSessionObserver, 25 // MediaSession allows clients to observe its changes via MediaSessionObserver,
25 // and allows clients to resume/suspend/stop the managed players. 26 // and allows clients to resume/suspend/stop the managed players.
26 class MediaSession { 27 class MediaSession {
27 public: 28 public:
28 enum class SuspendType { 29 enum class SuspendType {
(...skipping 28 matching lines...) Expand all
57 58
58 // Let the media session start ducking such that the volume multiplier is 59 // Let the media session start ducking such that the volume multiplier is
59 // reduced. 60 // reduced.
60 virtual void StartDucking() = 0; 61 virtual void StartDucking() = 0;
61 62
62 // Let the media session stop ducking such that the volume multiplier is 63 // Let the media session stop ducking such that the volume multiplier is
63 // recovered. 64 // recovered.
64 virtual void StopDucking() = 0; 65 virtual void StopDucking() = 0;
65 66
66 protected: 67 protected:
68 virtual void AddObserver(MediaSessionObserver* observer) = 0;
69 virtual void RemoveObserver(MediaSessionObserver* observer) = 0;
70
67 MediaSession() = default; 71 MediaSession() = default;
72
73 private:
74 friend class MediaSessionObserver;
mlamouri (slow - plz ping) 2017/01/16 11:13:20 This is a bit confusing. Why does an interface nee
derekjchow1 2017/01/18 02:25:33 https://cs.chromium.org/chromium/src/content/publi
Zhiqiang Zhang (Slow) 2017/01/18 21:57:51 I think you can follow the pattern of TestWebConte
derekjchow1 2017/01/19 01:28:14 I disagree. Inheriting from MediaSessionImpl means
Zhiqiang Zhang (Slow) 2017/01/19 11:12:45 I see, TestWebContents is in content/test instead
68 }; 75 };
69 76
70 } // namespace content 77 } // namespace content
71 78
72 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_ 79 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698