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> |
11 #include <utility> | 11 #include <utility> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "chrome/browser/media/router/media_router.h" | 18 #include "chrome/browser/media/router/media_router.h" |
19 #include "chrome/browser/media/router/media_source.h" | 19 #include "chrome/browser/media/router/media_source.h" |
20 #include "chrome/browser/media/router/presentation_request.h" | 20 #include "chrome/browser/media/router/presentation_request.h" |
21 #include "chrome/browser/media/router/render_frame_host_id.h" | 21 #include "chrome/browser/media/router/render_frame_host_id.h" |
22 #include "content/public/browser/presentation_service_delegate.h" | 22 #include "content/public/browser/presentation_service_delegate.h" |
23 #include "content/public/browser/web_contents_observer.h" | 23 #include "content/public/browser/web_contents_observer.h" |
24 #include "content/public/browser/web_contents_user_data.h" | 24 #include "content/public/browser/web_contents_user_data.h" |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class PresentationScreenAvailabilityListener; | 27 class PresentationScreenAvailabilityListener; |
28 class WebContents; | 28 class WebContents; |
29 struct PresentationSessionInfo; | 29 struct PresentationSessionInfo; |
30 struct PresentationSessionMessage; | 30 struct PresentationConnectionMessage; |
31 } // namespace content | 31 } // namespace content |
32 | 32 |
33 namespace media_router { | 33 namespace media_router { |
34 | 34 |
35 class MediaRoute; | 35 class MediaRoute; |
36 class PresentationFrameManager; | 36 class PresentationFrameManager; |
37 class RouteRequestResult; | 37 class RouteRequestResult; |
38 | 38 |
39 // Implementation of PresentationServiceDelegate that interfaces an instance of | 39 // Implementation of PresentationServiceDelegate that interfaces an instance of |
40 // WebContents with the Chrome Media Router. It uses the Media Router to handle | 40 // WebContents with the Chrome Media Router. It uses the Media Router to handle |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const std::vector<GURL>& presentation_urls, | 103 const std::vector<GURL>& presentation_urls, |
104 const std::string& presentation_id, | 104 const std::string& presentation_id, |
105 const content::PresentationSessionStartedCallback& success_cb, | 105 const content::PresentationSessionStartedCallback& success_cb, |
106 const content::PresentationSessionErrorCallback& error_cb) override; | 106 const content::PresentationSessionErrorCallback& error_cb) override; |
107 void CloseConnection(int render_process_id, | 107 void CloseConnection(int render_process_id, |
108 int render_frame_id, | 108 int render_frame_id, |
109 const std::string& presentation_id) override; | 109 const std::string& presentation_id) override; |
110 void Terminate(int render_process_id, | 110 void Terminate(int render_process_id, |
111 int render_frame_id, | 111 int render_frame_id, |
112 const std::string& presentation_id) override; | 112 const std::string& presentation_id) override; |
113 void ListenForSessionMessages( | 113 void ListenForConnectionMessages( |
114 int render_process_id, | 114 int render_process_id, |
115 int render_frame_id, | 115 int render_frame_id, |
116 const content::PresentationSessionInfo& session, | 116 const content::PresentationSessionInfo& session, |
117 const content::PresentationSessionMessageCallback& message_cb) override; | 117 const content::PresentationConnectionMessageCallback& message_cb) |
118 void SendMessage(int render_process_id, | 118 override; |
119 int render_frame_id, | 119 void SendMessage( |
120 const content::PresentationSessionInfo& session, | 120 int render_process_id, |
121 std::unique_ptr<content::PresentationSessionMessage> message, | 121 int render_frame_id, |
122 const SendMessageCallback& send_message_cb) override; | 122 const content::PresentationSessionInfo& session, |
| 123 std::unique_ptr<content::PresentationConnectionMessage> message, |
| 124 const SendMessageCallback& send_message_cb) override; |
123 void ListenForConnectionStateChange( | 125 void ListenForConnectionStateChange( |
124 int render_process_id, | 126 int render_process_id, |
125 int render_frame_id, | 127 int render_frame_id, |
126 const content::PresentationSessionInfo& connection, | 128 const content::PresentationSessionInfo& connection, |
127 const content::PresentationConnectionStateChangedCallback& | 129 const content::PresentationConnectionStateChangedCallback& |
128 state_changed_cb) override; | 130 state_changed_cb) override; |
129 | 131 |
130 // Callback invoked when a default PresentationRequest is started from a | 132 // Callback invoked when a default PresentationRequest is started from a |
131 // browser-initiated dialog. | 133 // browser-initiated dialog. |
132 void OnRouteResponse(const PresentationRequest& request, | 134 void OnRouteResponse(const PresentationRequest& request, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 std::unique_ptr<PresentationFrameManager> frame_manager_; | 204 std::unique_ptr<PresentationFrameManager> frame_manager_; |
203 | 205 |
204 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; | 206 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; |
205 | 207 |
206 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); | 208 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); |
207 }; | 209 }; |
208 | 210 |
209 } // namespace media_router | 211 } // namespace media_router |
210 | 212 |
211 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 213 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
OLD | NEW |