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_PEPPER_WEB_CONTENTS_OBSERVER_H_ | |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PEPPER_WEB_CONTENTS_OBSERVER_H_ | |
| 7 | |
| 8 #include "content/public/browser/web_contents_observer.h" | |
| 9 | |
| 10 #include <map> | |
| 11 #include <memory> | |
| 12 #include <set> | |
| 13 | |
| 14 namespace content { | |
| 15 class PepperPlayerDelegate; | |
|
mlamouri (slow - plz ping)
2016/06/24 15:33:32
style: empty line after `namespace content {'
Zhiqiang Zhang (Slow)
2016/06/24 17:43:21
Done.
| |
| 16 class MediaSession; | |
| 17 | |
| 18 class CONTENT_EXPORT PepperWebContentsObserver : public WebContentsObserver { | |
| 19 public: | |
| 20 explicit PepperWebContentsObserver(WebContents* web_contents); | |
| 21 ~PepperWebContentsObserver() override; | |
| 22 | |
| 23 void WebContentsDestroyed() override; | |
| 24 void PepperInstanceCreated(int32_t pp_instance) override; | |
| 25 void PepperInstanceDeleted(int32_t pp_instance) override; | |
| 26 | |
| 27 bool OnMessageReceived(const IPC::Message& msg, | |
| 28 RenderFrameHost* render_frame_host) override; | |
| 29 void OnPepperStartsPlayback(int32_t pp_instance); | |
| 30 void OnPepperStopsPlayback(int32_t pp_instance); | |
| 31 | |
| 32 private: | |
| 33 | |
| 34 using PlayersMap = | |
| 35 std::map<int32_t, std::unique_ptr<PepperPlayerDelegate>>; | |
| 36 PlayersMap players_map_; | |
| 37 // The set of all active players. A Pepper player is active once it starts | |
| 38 // playback once, and it will keep being active until the Pepper instance is | |
| 39 // deleted. | |
| 40 std::set<int32_t> active_players_; | |
| 41 | |
| 42 MediaSession* media_session_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(PepperWebContentsObserver); | |
| 45 }; | |
| 46 } | |
|
mlamouri (slow - plz ping)
2016/06/24 15:33:32
style: empty line before } and add " // namespace
Zhiqiang Zhang (Slow)
2016/06/24 17:43:21
Done.
| |
| 47 | |
| 48 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PEPPER_WEB_CONTENTS_OBSERVER_H_ | |
| OLD | NEW |