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

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

Issue 2441423002: Add MediaSessionObserver to allow clients observe MediaSession directly (Closed)
Patch Set: don't store session pointer in observer, remove StopObserving() Created 4 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_OBSERVER_H_
7
8 #include "base/macros.h"
9 #include "base/optional.h"
10 #include "content/common/content_export.h"
11 #include "content/public/common/media_metadata.h"
12
13 namespace content {
14
15 class MediaSession;
16 class MediaSessionImpl;
17
18 // The observer for observing MediaSession events.
19 class CONTENT_EXPORT MediaSessionObserver {
20 public:
21 // Called when the observed MediaSession is being destroyed. Subclasses must
22 // do clean up in this method.
23 virtual void MediaSessionDestroyed() = 0;
24
25 // Called when the observed MediaSession has changed its state.
26 virtual void MediaSessionStateChanged(bool is_controllable,
27 bool is_suspended) {}
28
29 // Called when the observed MediaSession has changed metadata.
30 virtual void MediaSessionMetadataChanged(
31 const base::Optional<MediaMetadata>& metadata) {}
32
33 protected:
34 // Create a MediaSessionObserver and start observing |session|.
35 explicit MediaSessionObserver(MediaSession* session);
36 virtual ~MediaSessionObserver() = default;
37
38 private:
39 DISALLOW_COPY_AND_ASSIGN(MediaSessionObserver);
40 };
41
42 } // namespace content
43
44 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_SESSION_OBSERVER_H_
OLDNEW
« no previous file with comments | « content/public/browser/media_session.h ('k') | content/public/browser/media_session_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698