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

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: Super rough, please give some initial feedbacks Created 4 years, 2 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
(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/public/common/media_metadata.h"
11
12 namespace content {
13
14 class MediaSession;
15
16 class MediaSessionObserver {
17 public:
18 explicit MediaSessionObserver(MediaSession* session);
19 virtual ~MediaSessionObserver() = default;
whywhat 2016/10/20 15:38:33 if you "unobserve" in dtor, you can probably remov
Zhiqiang Zhang (Slow) 2016/10/20 16:22:32 Yes. It is now in the new patch.
20
21 MediaSession* session() { return session_; }
22
23 virtual void MediaSessionDisconnected() {}
24
25 virtual void MediaSessionStateChanged(
26 bool is_controllable, bool is_suspended) {}
27
28 virtual void MediaSessionMetadataChanged(
29 const base::Optional<MediaMetadata>& metadata) {}
30
31 private:
32 void Observe(MediaSession* session);
33
34 // Weak pointer to MediaSession, this class is owned by MediaSession.
35 MediaSession* session_;
36
37 DISALLOW_COPY_AND_ASSIGN(MediaSessionObserver);
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698