| OLD | NEW |
| (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_ |
| OLD | NEW |