| 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 a9a73dd0304d38aaf74b270b1646c82d89a4db1c..cc639849786e952c90d91e5e2eba4bd679d188d5 100644
|
| --- a/content/browser/presentation/presentation_service_impl.cc
|
| +++ b/content/browser/presentation/presentation_service_impl.cc
|
| @@ -187,7 +187,7 @@ void PresentationServiceImpl::ListenForScreenAvailability(
|
| }
|
|
|
| const std::string& availability_url = url.get();
|
| - if (screen_availability_listeners_.count(availability_url))
|
| + if (ContainsKey(screen_availability_listeners_, availability_url))
|
| return;
|
|
|
| std::unique_ptr<ScreenAvailabilityListenerImpl> listener(
|
| @@ -460,6 +460,31 @@ void PresentationServiceImpl::ListenForSessionMessages(
|
| weak_factory_.GetWeakPtr(), session_info));
|
| }
|
|
|
| +void PresentationServiceImpl::GetReceiverConnections(
|
| + const PresentationConnectionListMojoCallback& callback) {
|
| + DCHECK(!callback.is_null());
|
| + DVLOG(2) << "GetPresentationReceiverSession";
|
| + if (!delegate_) {
|
| + callback.Run(mojo::Array<blink::mojom::PresentationSessionInfoPtr>());
|
| + return;
|
| + }
|
| +
|
| + std::vector<PresentationSessionInfo> connections =
|
| + delegate_->GetReceiverConnections(
|
| + render_process_id_, render_frame_id_,
|
| + base::Bind(&PresentationServiceImpl::OnReceiverConnectionAvailable,
|
| + weak_factory_.GetWeakPtr()));
|
| + callback.Run(
|
| + mojo::Array<blink::mojom::PresentationSessionInfoPtr>::From(connections));
|
| +}
|
| +
|
| +void PresentationServiceImpl::OnReceiverConnectionAvailable(
|
| + const content::PresentationSessionInfo& connection) {
|
| + DCHECK(client_);
|
| + client_->OnReceiverConnectionAvailable(
|
| + blink::mojom::PresentationSessionInfo::From(connection));
|
| +}
|
| +
|
| void PresentationServiceImpl::OnSessionMessages(
|
| const PresentationSessionInfo& session,
|
| const ScopedVector<PresentationSessionMessage>& messages,
|
|
|