OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 class PresentationScreenAvailabilityListener; | 28 class PresentationScreenAvailabilityListener; |
29 class WebContents; | 29 class WebContents; |
30 struct PresentationSessionInfo; | 30 struct PresentationSessionInfo; |
31 struct PresentationSessionMessage; | 31 struct PresentationSessionMessage; |
32 } // namespace content | 32 } // namespace content |
33 | 33 |
34 namespace media_router { | 34 namespace media_router { |
35 | 35 |
36 class MediaRoute; | 36 class MediaRoute; |
37 class MediaSinksObserver; | 37 class MediaSinksObserver; |
| 38 class OffscreenPresentationManager; |
38 class PresentationFrameManager; | 39 class PresentationFrameManager; |
39 class RouteRequestResult; | 40 class RouteRequestResult; |
40 | 41 |
41 // Implementation of PresentationServiceDelegate that interfaces an | 42 // Implementation of PresentationServiceDelegate that interfaces an |
42 // instance of WebContents with the Chrome Media Router. It uses the Media | 43 // instance of WebContents with the Chrome Media Router. It uses the Media |
43 // Router to handle presentation API calls forwarded from | 44 // Router to handle presentation API calls forwarded from |
44 // PresentationServiceImpl. In addition, it also | 45 // PresentationServiceImpl. In addition, it also |
45 // provides default presentation URL that is required for creating | 46 // provides default presentation URL that is required for creating |
46 // browser-initiated sessions. | 47 // browser-initiated sessions. |
47 // It is scoped to the lifetime of a WebContents, and is managed by the | 48 // It is scoped to the lifetime of a WebContents, and is managed by the |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 int render_frame_id, | 124 int render_frame_id, |
124 const content::PresentationSessionInfo& session, | 125 const content::PresentationSessionInfo& session, |
125 std::unique_ptr<content::PresentationSessionMessage> message, | 126 std::unique_ptr<content::PresentationSessionMessage> message, |
126 const SendMessageCallback& send_message_cb) override; | 127 const SendMessageCallback& send_message_cb) override; |
127 void ListenForConnectionStateChange( | 128 void ListenForConnectionStateChange( |
128 int render_process_id, | 129 int render_process_id, |
129 int render_frame_id, | 130 int render_frame_id, |
130 const content::PresentationSessionInfo& connection, | 131 const content::PresentationSessionInfo& connection, |
131 const content::PresentationConnectionStateChangedCallback& | 132 const content::PresentationConnectionStateChangedCallback& |
132 state_changed_cb) override; | 133 state_changed_cb) override; |
| 134 void RegisterReceiverAvailableCallback( |
| 135 const content::ReceiverConnectionAvailableCallback& |
| 136 receiver_available_callback) override; |
| 137 void RegisterOffscreenPresentationConnection( |
| 138 int render_process_id, |
| 139 int render_frame_id, |
| 140 const content::PresentationSessionInfo& session, |
| 141 content::PresentationConnectionPtr connection) override; |
133 | 142 |
134 // Callback invoked when a default PresentationRequest is started from a | 143 // Callback invoked when a default PresentationRequest is started from a |
135 // browser-initiated dialog. | 144 // browser-initiated dialog. |
136 void OnRouteResponse(const PresentationRequest& request, | 145 void OnRouteResponse(const PresentationRequest& request, |
137 const RouteRequestResult& result); | 146 const RouteRequestResult& result); |
138 | 147 |
139 // Adds / removes an observer for listening to default PresentationRequest | 148 // Adds / removes an observer for listening to default PresentationRequest |
140 // changes. This class does not own |observer|. When |observer| is about to | 149 // changes. This class does not own |observer|. When |observer| is about to |
141 // be destroyed, |RemoveDefaultPresentationRequestObserver| must be called. | 150 // be destroyed, |RemoveDefaultPresentationRequestObserver| must be called. |
142 void AddDefaultPresentationRequestObserver( | 151 void AddDefaultPresentationRequestObserver( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 const content::PresentationSessionInfo& new_session, | 206 const content::PresentationSessionInfo& new_session, |
198 const MediaRoute::Id& route_id); | 207 const MediaRoute::Id& route_id); |
199 | 208 |
200 // References to the WebContents that owns this instance, and associated | 209 // References to the WebContents that owns this instance, and associated |
201 // browser profile's MediaRouter instance. | 210 // browser profile's MediaRouter instance. |
202 content::WebContents* const web_contents_; | 211 content::WebContents* const web_contents_; |
203 MediaRouter* router_; | 212 MediaRouter* router_; |
204 | 213 |
205 std::unique_ptr<PresentationFrameManager> frame_manager_; | 214 std::unique_ptr<PresentationFrameManager> frame_manager_; |
206 | 215 |
| 216 OffscreenPresentationManager* offscreen_presentation_manager_; |
| 217 |
207 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; | 218 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; |
208 | 219 |
209 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); | 220 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); |
210 }; | 221 }; |
211 | 222 |
212 } // namespace media_router | 223 } // namespace media_router |
213 | 224 |
214 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 225 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
OLD | NEW |