Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Unified Diff: content/browser/presentation/presentation_service_impl.cc

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698