| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_OFFSCREEN_PRESENTATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Note calling this will trigger receiver frame's | 43 // Note calling this will trigger receiver frame's |
| 44 // PresentationServiceImpl::OnReceiverConnectionAvailable. | 44 // PresentationServiceImpl::OnReceiverConnectionAvailable. |
| 45 // | 45 // |
| 46 // manager->RegisterOffscreenPresentationController( | 46 // manager->RegisterOffscreenPresentationController( |
| 47 // presentation_id, controller_frame_id, controller_connection_ptr, | 47 // presentation_id, controller_frame_id, controller_connection_ptr, |
| 48 // receiver_connection_request); | 48 // receiver_connection_request); |
| 49 // | 49 // |
| 50 // Invoked on receiver's PresentationServiceImpl when controller connection is | 50 // Invoked on receiver's PresentationServiceImpl when controller connection is |
| 51 // established. | 51 // established. |
| 52 // | 52 // |
| 53 // |presentation_receiver_client_|: blink::mojom::PresentationServiceClienPtr | 53 // |presentation_receiver_client_|: |
| 54 // for the presentation receiver. | 54 // content::mojom::PresentationServiceClientPtr for the presentation |
| 55 // |controller_connection_ptr|: blink::mojom::PresentationConnectionPtr for | 55 // receiver. |
| 56 // blink::PresentationConnection object in controlling frame's render process. | 56 // |controller_connection_ptr|: content::mojom::PresentationConnectionPtr for |
| 57 // blink::PresentationConnection object in controlling frame's render |
| 58 // process. |
| 57 // |receiver_connection_request|: Mojo InterfaceRequest to be bind to | 59 // |receiver_connection_request|: Mojo InterfaceRequest to be bind to |
| 58 // blink::PresentationConnection object in receiver frame's render process. | 60 // blink::PresentationConnection object in receiver frame's render |
| 61 // process. |
| 59 // void PresentationServiceImpl::OnReceiverConnectionAvailable( | 62 // void PresentationServiceImpl::OnReceiverConnectionAvailable( |
| 60 // const content::PresentationSessionInfo& session, | 63 // const content::PresentationSessionInfo& session, |
| 61 // PresentationConnectionPtr controller_connection_ptr, | 64 // PresentationConnectionPtr controller_connection_ptr, |
| 62 // PresentationConnectionRequest receiver_connection_request) { | 65 // PresentationConnectionRequest receiver_connection_request) { |
| 63 // presentation_receiver_client_->OnReceiverConnectionAvailable( | 66 // presentation_receiver_client_->OnReceiverConnectionAvailable( |
| 64 // blink::mojom::PresentationSessionInfo::From(session_info), | 67 // content::mojom::PresentationSessionInfo::From(session_info), |
| 65 // std::move(controller_connection_ptr), | 68 // std::move(controller_connection_ptr), |
| 66 // std::move(receiver_connection_request)); | 69 // std::move(receiver_connection_request)); |
| 67 // } | 70 // } |
| 68 // | 71 // |
| 69 // Send message from controlling/receiver frame to receiver/controlling frame: | 72 // Send message from controlling/receiver frame to receiver/controlling frame: |
| 70 // | 73 // |
| 71 // |target_connection_|: member variable of | 74 // |target_connection_|: member variable of |
| 72 // blink::mojom::PresentationConnectionPtr type, | 75 // content::mojom::PresentationConnectionPtr type, |
| 73 // refering to remote PresentationConnectionProxy | 76 // refering to remote PresentationConnectionProxy |
| 74 // object on receiver/controlling frame. | 77 // object on receiver/controlling frame. |
| 75 // |message|: Text message to be sent. | 78 // |message|: Text message to be sent. |
| 76 // PresentationConnctionPtr::SendString( | 79 // PresentationConnctionPtr::SendString( |
| 77 // const blink::WebString& message) { | 80 // const blink::WebString& message) { |
| 78 // target_connection_->OnSessionMessageReceived(std::move(session_message)); | 81 // target_connection_->OnSessionMessageReceived(std::move(session_message)); |
| 79 // } | 82 // } |
| 80 // | 83 // |
| 81 // A controller or receiver leaves the offscreen presentation (e.g., due to | 84 // A controller or receiver leaves the offscreen presentation (e.g., due to |
| 82 // navigation) by unregistering themselves from OffscreenPresentation object. | 85 // navigation) by unregistering themselves from OffscreenPresentation object. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 OffscreenPresentationMap offscreen_presentations_; | 233 OffscreenPresentationMap offscreen_presentations_; |
| 231 | 234 |
| 232 base::ThreadChecker thread_checker_; | 235 base::ThreadChecker thread_checker_; |
| 233 | 236 |
| 234 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentationManager); | 237 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentationManager); |
| 235 }; | 238 }; |
| 236 | 239 |
| 237 } // namespace media_router | 240 } // namespace media_router |
| 238 | 241 |
| 239 #endif // CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_H_ | 242 #endif // CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_H_ |
| OLD | NEW |