Index: content/browser/presentation/presentation_service_impl.cc |
diff --git a/content/browser/presentation/presentation_service_impl.cc b/content/browser/presentation/presentation_service_impl.cc |
index f575a0e42f8d7af30ebb65f3724960de6e059c8e..90f60e7b2f3a40843f79b663090249c75c3f09ef 100644 |
--- a/content/browser/presentation/presentation_service_impl.cc |
+++ b/content/browser/presentation/presentation_service_impl.cc |
@@ -302,16 +302,13 @@ int PresentationServiceImpl::RegisterJoinSessionCallback( |
return request_id; |
} |
-void PresentationServiceImpl::ListenForConnectionStateChangeAndChangeState( |
+void PresentationServiceImpl::ListenForConnectionStateChange( |
const PresentationSessionInfo& connection) { |
if (controller_delegate_) { |
controller_delegate_->ListenForConnectionStateChange( |
render_process_id_, render_frame_id_, connection, |
base::Bind(&PresentationServiceImpl::OnConnectionStateChanged, |
weak_factory_.GetWeakPtr(), connection)); |
- OnConnectionStateChanged(connection, |
- PresentationConnectionStateChangeInfo( |
- PRESENTATION_CONNECTION_STATE_CONNECTED)); |
} |
} |
@@ -325,7 +322,7 @@ void PresentationServiceImpl::OnStartSessionSucceeded( |
pending_start_session_cb_->Run( |
blink::mojom::PresentationSessionInfo::From(session_info), |
blink::mojom::PresentationErrorPtr()); |
- ListenForConnectionStateChangeAndChangeState(session_info); |
+ ListenForConnectionStateChange(session_info); |
pending_start_session_cb_.reset(); |
start_session_request_id_ = kInvalidRequestSessionId; |
} |
@@ -350,7 +347,7 @@ void PresentationServiceImpl::OnJoinSessionSucceeded( |
request_session_id, |
blink::mojom::PresentationSessionInfo::From(session_info), |
blink::mojom::PresentationErrorPtr())) { |
- ListenForConnectionStateChangeAndChangeState(session_info); |
+ ListenForConnectionStateChange(session_info); |
} |
} |
@@ -499,9 +496,9 @@ void PresentationServiceImpl::SetPresentationConnection( |
return; |
PresentationSessionInfo session_info(session.To<PresentationSessionInfo>()); |
- controller_delegate_->ConnectToOffscreenPresentation( |
- render_process_id_, render_frame_id_, session_info, |
- std::move(connection)); |
+ controller_delegate_->ConnectToPresentation(render_process_id_, |
+ render_frame_id_, session_info, |
+ std::move(connection)); |
} |
void PresentationServiceImpl::OnSessionMessages( |
@@ -526,6 +523,10 @@ void PresentationServiceImpl::OnReceiverConnectionAvailable( |
const content::PresentationSessionInfo& session_info, |
PresentationConnectionPtr&& controller) { |
DVLOG(2) << "PresentationServiceImpl::OnReceiverConnectionAvailable"; |
+ |
+ client_->OnReceiverConnectionAvailable( |
+ blink::mojom::PresentationSessionInfo::From(session_info), |
+ std::move(controller)); |
} |
void PresentationServiceImpl::DidNavigateAnyFrame( |
@@ -612,7 +613,7 @@ void PresentationServiceImpl::OnDefaultPresentationStarted( |
DCHECK(client_.get()); |
client_->OnDefaultSessionStarted( |
blink::mojom::PresentationSessionInfo::From(connection)); |
- ListenForConnectionStateChangeAndChangeState(connection); |
+ ListenForConnectionStateChange(connection); |
} |
PresentationServiceImpl::ScreenAvailabilityListenerImpl:: |