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

Side by Side Diff: chrome/browser/media/router/presentation_frame_map.h

Issue 1132903002: [MediaRouter] Add implementation of PresentationServiceDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 2015 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 CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_MAP_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_MAP_H_
7
8 #include <map>
9
10 #include "base/containers/scoped_ptr_hash_map.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/browser/presentation_service_delegate.h"
13
14 namespace content {
15 class PresentationScreenAvailabilityListener;
16 class WebContents;
17 }
18
19 namespace media_router {
20 class PresentationFrame;
21
22 // Helper class for PresentationServiceDelegateImpl to manage
mark a. foltz 2015/05/14 22:20:46 Similar comments to PresentationFrame: - If it is
haibinlu 2015/05/15 23:32:29 Merged to PSDI.cc
23 // PresentationFrames.
24 class PresentationFrameMap {
25 public:
26 using RenderFrameHostId =
27 content::PresentationServiceDelegate::RenderFrameHostId;
28 using DelegateObserver = content::PresentationServiceDelegate::Observer;
29
30 explicit PresentationFrameMap(content::WebContents* web_contents);
31 ~PresentationFrameMap();
mark a. foltz 2015/05/14 22:20:45 virtual
haibinlu 2015/05/15 23:32:29 Done.
32
33 bool AddScreenAvailabilityListener(
mark a. foltz 2015/05/14 22:20:45 Add docstrings to public method declarations
haibinlu 2015/05/15 23:32:29 Done.
34 int render_process_id,
35 int render_frame_id,
36 content::PresentationScreenAvailabilityListener* listener);
37 void RemoveScreenAvailabilityListener(
38 int render_process_id,
39 int render_frame_id,
40 content::PresentationScreenAvailabilityListener* listener);
41
42 void SetDefaultPresentationInfo(int render_process_id,
43 int render_frame_id,
44 const std::string& default_presentation_url,
45 const std::string& default_presentation_id);
46 // Return empty string if no default presentation ID is set in the frame.
47 std::string GetDefaultPresentationId(RenderFrameHostId rfh_id) const;
48
49 void SetDelegateObserver(int render_process_id,
50 int render_frame_id,
51 DelegateObserver* observer);
52 DelegateObserver* GetDelegateObserver(RenderFrameHostId rfh_id) const;
53
54 void Reset(int render_process_id, int render_frame_id);
55
56 private:
57 base::ScopedPtrHashMap<RenderFrameHostId, scoped_ptr<PresentationFrame>>
mark a. foltz 2015/05/14 22:20:45 Add a comment explaining this map, i.e. "Maps a fr
haibinlu 2015/05/15 23:32:29 Done.
58 frames_;
59
60 size_t num_sink_observers_;
mark a. foltz 2015/05/14 22:20:45 What is a sink observer in this context? Is it th
haibinlu 2015/05/15 23:32:29 Removed. Calculated # of screen availability liste
61
62 // Does not own these two objects.
mark a. foltz 2015/05/14 22:20:45 Please comment about why this is okay.
63 MediaRouter* router_;
64 content::WebContents* web_contents_;
65 };
66
67 } // namespace media_router
68
69 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698