| 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 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 } | 742 } |
| 743 } | 743 } |
| 744 | 744 |
| 745 void PresentationServiceDelegateImpl::JoinSession( | 745 void PresentationServiceDelegateImpl::JoinSession( |
| 746 int render_process_id, | 746 int render_process_id, |
| 747 int render_frame_id, | 747 int render_frame_id, |
| 748 const std::string& presentation_url, | 748 const std::string& presentation_url, |
| 749 const std::string& presentation_id, | 749 const std::string& presentation_id, |
| 750 const content::PresentationSessionStartedCallback& success_cb, | 750 const content::PresentationSessionStartedCallback& success_cb, |
| 751 const content::PresentationSessionErrorCallback& error_cb) { | 751 const content::PresentationSessionErrorCallback& error_cb) { |
| 752 bool off_the_record = web_contents_->GetBrowserContext()->IsOffTheRecord(); | 752 bool incognito = web_contents_->GetBrowserContext()->IsOffTheRecord(); |
| 753 std::vector<MediaRouteResponseCallback> route_response_callbacks; | 753 std::vector<MediaRouteResponseCallback> route_response_callbacks; |
| 754 route_response_callbacks.push_back(base::Bind( | 754 route_response_callbacks.push_back(base::Bind( |
| 755 &PresentationServiceDelegateImpl::OnJoinRouteResponse, | 755 &PresentationServiceDelegateImpl::OnJoinRouteResponse, |
| 756 weak_factory_.GetWeakPtr(), render_process_id, render_frame_id, | 756 weak_factory_.GetWeakPtr(), render_process_id, render_frame_id, |
| 757 content::PresentationSessionInfo(presentation_url, presentation_id), | 757 content::PresentationSessionInfo(presentation_url, presentation_id), |
| 758 success_cb, error_cb)); | 758 success_cb, error_cb)); |
| 759 router_->JoinRoute(MediaSourceForPresentationUrl(presentation_url).id(), | 759 router_->JoinRoute( |
| 760 presentation_id, | 760 MediaSourceForPresentationUrl(presentation_url).id(), presentation_id, |
| 761 GetLastCommittedURLForFrame( | 761 GetLastCommittedURLForFrame( |
| 762 RenderFrameHostId(render_process_id, render_frame_id)) | 762 RenderFrameHostId(render_process_id, render_frame_id)) |
| 763 .GetOrigin(), | 763 .GetOrigin(), |
| 764 web_contents_, route_response_callbacks, base::TimeDelta(), | 764 web_contents_, route_response_callbacks, base::TimeDelta(), incognito); |
| 765 off_the_record); | |
| 766 } | 765 } |
| 767 | 766 |
| 768 void PresentationServiceDelegateImpl::CloseConnection( | 767 void PresentationServiceDelegateImpl::CloseConnection( |
| 769 int render_process_id, | 768 int render_process_id, |
| 770 int render_frame_id, | 769 int render_frame_id, |
| 771 const std::string& presentation_id) { | 770 const std::string& presentation_id) { |
| 772 const RenderFrameHostId rfh_id(render_process_id, render_frame_id); | 771 const RenderFrameHostId rfh_id(render_process_id, render_frame_id); |
| 773 const MediaRoute::Id& route_id = | 772 const MediaRoute::Id& route_id = |
| 774 frame_manager_->GetRouteId(rfh_id, presentation_id); | 773 frame_manager_->GetRouteId(rfh_id, presentation_id); |
| 775 if (route_id.empty()) { | 774 if (route_id.empty()) { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( | 888 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( |
| 890 int render_process_id, | 889 int render_process_id, |
| 891 int render_frame_id, | 890 int render_frame_id, |
| 892 const MediaSource::Id& source_id) const { | 891 const MediaSource::Id& source_id) const { |
| 893 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); | 892 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); |
| 894 return frame_manager_->HasScreenAvailabilityListenerForTest( | 893 return frame_manager_->HasScreenAvailabilityListenerForTest( |
| 895 render_frame_host_id, source_id); | 894 render_frame_host_id, source_id); |
| 896 } | 895 } |
| 897 | 896 |
| 898 } // namespace media_router | 897 } // namespace media_router |
| OLD | NEW |