Chromium Code Reviews| Index: chrome/browser/media/router/presentation_service_delegate_impl.cc |
| diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc |
| index d0c574cfd30e5b0d9beee443660035d56d5e9618..661b307a4ccdd59acae5cd3eab9317203bfcc648 100644 |
| --- a/chrome/browser/media/router/presentation_service_delegate_impl.cc |
| +++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc |
| @@ -731,7 +731,7 @@ void PresentationServiceDelegateImpl::SetDefaultPresentationUrls( |
| void PresentationServiceDelegateImpl::OnJoinRouteResponse( |
| int render_process_id, |
| int render_frame_id, |
| - const content::PresentationSessionInfo& session, |
| + const GURL& presentation_url, |
|
mark a. foltz
2016/11/09 19:28:23
Thanks for doing this; it is necessary for support
zhaobin
2016/11/11 18:41:51
Done.
|
| const content::PresentationSessionStartedCallback& success_cb, |
| const content::PresentationSessionErrorCallback& error_cb, |
| const RouteRequestResult& result) { |
| @@ -741,9 +741,11 @@ void PresentationServiceDelegateImpl::OnJoinRouteResponse( |
| } else { |
| DVLOG(1) << "OnJoinRouteResponse: " |
| << "route_id: " << result.route()->media_route_id() |
| - << ", presentation URL: " << session.presentation_url |
| - << ", presentation ID: " << session.presentation_id; |
| - DCHECK_EQ(session.presentation_id, result.presentation_id()); |
| + << ", presentation URL: " << presentation_url |
| + << ", presentation ID: " << result.presentation_id(); |
| + content::PresentationSessionInfo session( |
| + presentation_url, result.presentation_id(), |
| + result.route()->is_offscreen_presentation()); |
| frame_manager_->OnPresentationSessionStarted( |
| RenderFrameHostId(render_process_id, render_frame_id), session, |
| result.route()->media_route_id()); |
| @@ -756,11 +758,13 @@ void PresentationServiceDelegateImpl::OnStartSessionSucceeded( |
| int render_frame_id, |
| const content::PresentationSessionStartedCallback& success_cb, |
| const content::PresentationSessionInfo& new_session, |
| - const MediaRoute::Id& route_id) { |
| + const MediaRoute& route) { |
| + const MediaRoute::Id& route_id = route.media_route_id(); |
| DVLOG(1) << "OnStartSessionSucceeded: " |
| << "route_id: " << route_id |
| << ", presentation URL: " << new_session.presentation_url |
| - << ", presentation ID: " << new_session.presentation_id; |
| + << ", presentation ID: " << new_session.presentation_id |
| + << ", is_offscreen_presentation: " << new_session.is_offscreen; |
| frame_manager_->OnPresentationSessionStarted( |
| RenderFrameHostId(render_process_id, render_frame_id), new_session, |
| route_id); |
| @@ -824,11 +828,10 @@ void PresentationServiceDelegateImpl::JoinSession( |
| const GURL& presentation_url = presentation_urls[0]; |
| bool incognito = web_contents_->GetBrowserContext()->IsOffTheRecord(); |
| std::vector<MediaRouteResponseCallback> route_response_callbacks; |
| - route_response_callbacks.push_back(base::Bind( |
| - &PresentationServiceDelegateImpl::OnJoinRouteResponse, |
| - weak_factory_.GetWeakPtr(), render_process_id, render_frame_id, |
| - content::PresentationSessionInfo(presentation_url, presentation_id), |
| - success_cb, error_cb)); |
| + route_response_callbacks.push_back( |
| + base::Bind(&PresentationServiceDelegateImpl::OnJoinRouteResponse, |
|
mark a. foltz
2016/11/09 19:28:23
It would be ideal to also include the presentation
zhaobin
2016/11/11 18:41:51
Done.
|
| + weak_factory_.GetWeakPtr(), render_process_id, render_frame_id, |
| + presentation_url, success_cb, error_cb)); |
| router_->JoinRoute( |
| MediaSourceForPresentationUrl(presentation_url).id(), presentation_id, |
| GetLastCommittedURLForFrame( |
| @@ -922,7 +925,8 @@ void PresentationServiceDelegateImpl::OnRouteResponse( |
| return; |
| content::PresentationSessionInfo session_info( |
| - presentation_request.presentation_url(), result.presentation_id()); |
| + presentation_request.presentation_url(), result.presentation_id(), |
| + result.route()->is_offscreen_presentation()); |
| frame_manager_->OnDefaultPresentationSessionStarted( |
| presentation_request, session_info, result.route()->media_route_id()); |
| } |