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

Side by Side Diff: content/browser/media/session/media_session_observer.h

Issue 2439483003: Link MediaSessionTabHelper with native MediaSession [CL is going to be split] (Closed)
Patch Set: Don't review, this CL is getting huge and needs to be split 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_BROWSER_MEDIA_SESSION_MEDIA_SESSION_OBSERVER_H_
6 #define CONTENT_BROWSER_MEDIA_SESSION_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
17 // The observer for MediaSession events.
18 class CONTENT_EXPORT MediaSessionObserver {
19 public:
20 // Create a MediaSessionObserver and start observing |session|.
21 explicit MediaSessionObserver(MediaSession* session);
22 // Destructor of MediaSessionObserver. It will remove itself from |session| if
23 // the observer is still observing a MediaSession.
24 virtual ~MediaSessionObserver();
25
26 // Gets the observed MediaSession.
27 MediaSession* session() { return session_; }
28
29 // Called when the observed MediaSession is destroyed.
30 virtual void MediaSessionDestroyed() {}
31
32 // Called when the observed MediaSession has changed its state.
33 virtual void MediaSessionStateChanged(bool is_controllable,
34 bool is_suspended) {}
35
36 // Called when the observed MediaSession has changed metadata.
37 virtual void MediaSessionMetadataChanged(
38 const base::Optional<MediaMetadata>& metadata) {}
39
40 private:
41 // Weak pointer to MediaSession.
42 MediaSession* session_;
43
44 DISALLOW_COPY_AND_ASSIGN(MediaSessionObserver);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_OBSERVER_H_
OLDNEW
« no previous file with comments | « content/browser/media/session/media_session_browsertest.cc ('k') | content/browser/media/session/media_session_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698