OLD | NEW |
---|---|
(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_H_ | |
6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_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 | |
21 // Helper class for PresentationServiceDelegateImpl to manage | |
22 // listeners and default presentation info in a render frame. | |
23 class PresentationFrame { | |
mark a. foltz
2015/05/14 22:20:45
If this is used only by PSDI then I would declare
haibinlu
2015/05/15 23:32:29
Merged into PSDI.cc
| |
24 public: | |
25 using DelegateObserver = content::PresentationServiceDelegate::Observer; | |
26 | |
27 explicit PresentationFrame(content::WebContents* web_contents); | |
28 ~PresentationFrame(); | |
mark a. foltz
2015/05/14 22:20:45
virtual
haibinlu
2015/05/15 23:32:29
Done.
| |
29 | |
30 // Return true if listener was added. | |
mark a. foltz
2015/05/14 22:20:45
s/Return/Returns/ here and below
haibinlu
2015/05/15 23:32:29
Done.
| |
31 bool AddScreenAvailabilityListener( | |
32 content::PresentationScreenAvailabilityListener* listener); | |
33 // Return true if listener was deleted. | |
34 bool RemoveScreenAvailabilityListener( | |
35 content::PresentationScreenAvailabilityListener* listener); | |
36 | |
37 void SetDefaultPresentationInfo(const std::string& default_presentation_url, | |
mark a. foltz
2015/05/14 22:20:45
Add docstring
haibinlu
2015/05/15 23:32:29
Done.
| |
38 const std::string& default_presentation_id); | |
39 // Return empty string if no default presentation ID is set. | |
40 std::string GetDefaultPresentationId() const; | |
41 | |
42 void SetDelegateObserver(DelegateObserver* observer); | |
mark a. foltz
2015/05/14 22:20:45
Add docstrings
haibinlu
2015/05/15 23:32:29
Done.
| |
43 DelegateObserver* GetDelegateObserver() const; | |
44 | |
45 void Reset(); | |
46 | |
47 private: | |
48 MediaSource GetMediaSourceFromListener( | |
49 content::PresentationScreenAvailabilityListener* listener); | |
50 | |
51 // Not owned by this class. | |
mark a. foltz
2015/05/14 22:20:45
What guarantees the lifetime of this?
| |
52 DelegateObserver* delegate_observer_; | |
53 | |
54 scoped_ptr<content::PresentationSessionInfo> default_presentation_info_; | |
55 base::ScopedPtrHashMap<MediaSourceId, scoped_ptr<MediaSinksObserver>> | |
56 sink_observers_; | |
57 | |
58 // Does not own these two objects. | |
59 MediaRouter* router_; | |
60 content::WebContents* web_contents_; | |
mark a. foltz
2015/05/14 22:20:45
Ditto for this
| |
61 }; | |
62 | |
63 } // namespace media_router | |
64 | |
65 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_H_ | |
OLD | NEW |