Chromium Code Reviews| 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_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ | |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ | |
| 7 | |
| 8 #include "base/id_map.h" | |
| 9 #include "content/public/browser/web_contents_observer.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 class PepperPlayerDelegate; | |
| 14 | |
| 15 // Class observing Pepper playback changes from WebContents, and update | |
| 16 // MediaSession accordingly. Can only be a member of WebContentsImpl and must be | |
| 17 // destroyed in ~WebContentsImpl(). | |
| 18 class PepperPlaybackObserver { | |
| 19 public: | |
| 20 explicit PepperPlaybackObserver(WebContents* contents); | |
| 21 virtual ~PepperPlaybackObserver(); | |
| 22 | |
| 23 void PepperInstanceCreated(int32_t pp_instance); | |
| 24 void PepperInstanceDeleted(int32_t pp_instance); | |
| 25 void PepperStartsPlayback(int32_t pp_instance); | |
| 26 void PepperStopsPlayback(int32_t pp_instance); | |
| 27 | |
| 28 private: | |
| 29 // Owning PepperPlayerDelegates. | |
| 30 using PlayersMap = | |
| 31 IDMap<PepperPlayerDelegate, IDMapOwnPointer, int32_t>; | |
| 32 PlayersMap players_map_; | |
| 33 | |
| 34 // Weak reference to WebContents. | |
| 35 WebContents* contents_; | |
|
dcheng
2016/06/30 07:02:39
Nit: suggest just making this a WebContentsImpl, t
Zhiqiang Zhang (Slow)
2016/06/30 12:46:54
Done.
| |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(PepperPlaybackObserver); | |
| 38 }; | |
| 39 | |
| 40 } // namespace content | |
| 41 | |
| 42 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ | |
| OLD | NEW |