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

Side by Side Diff: content/browser/media/session/pepper/pepper_web_contents_observer.h

Issue 2060933002: Let Flash join and be controlled by media session (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pepper_to_contents
Patch Set: modified when to add/remove player to/from MediaSession Created 4 years, 5 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_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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698