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

Unified Diff: content/renderer/presentation/presentation_dispatcher.cc

Issue 979413002: [Presentation API] Additional plumbing for PresentationServiceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@REAL-NEW-MASTER
Patch Set: rm presentation_session.mojom Created 5 years, 9 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
« no previous file with comments | « content/renderer/presentation/presentation_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/presentation/presentation_dispatcher.cc
diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc
index 839b5103d3cffbe6fd723efad54c2e06c098e2ef..d44b9929a0fb548a4422a2cb687de5d940acfd38 100644
--- a/content/renderer/presentation/presentation_dispatcher.cc
+++ b/content/renderer/presentation/presentation_dispatcher.cc
@@ -67,16 +67,20 @@ void PresentationDispatcher::setController(
void PresentationDispatcher::updateAvailableChangeWatched(bool watched) {
GURL presentation_url(GetPresentationURLFromFrame(render_frame()));
+ DoUpdateAvailableChangeWatched(presentation_url.spec(), watched);
+}
+void PresentationDispatcher::DoUpdateAvailableChangeWatched(
+ const std::string& presentation_url, bool watched) {
ConnectToPresentationServiceIfNeeded();
if (watched) {
presentation_service_->GetScreenAvailability(
- presentation_url.spec(),
+ presentation_url,
base::Bind(&PresentationDispatcher::OnScreenAvailabilityChanged,
base::Unretained(this)));
} else {
presentation_service_->OnScreenAvailabilityListenerRemoved(
- presentation_url.spec());
+ presentation_url);
}
}
@@ -124,12 +128,14 @@ void PresentationDispatcher::DidChangeDefaultPresentation() {
presentation_url.spec(), mojo::String());
}
-void PresentationDispatcher::OnScreenAvailabilityChanged(bool available) {
+void PresentationDispatcher::OnScreenAvailabilityChanged(
+ const std::string& presentation_url, bool available) {
if (!controller_)
return;
// Reset the callback to get the next event.
- updateAvailableChangeWatched(controller_->isAvailableChangeWatched());
+ DoUpdateAvailableChangeWatched(presentation_url,
+ controller_->isAvailableChangeWatched());
controller_->didChangeAvailability(available);
}
@@ -160,7 +166,7 @@ void PresentationDispatcher::OnSessionCreated(
if (!error.is_null()) {
DCHECK(session_info.is_null());
callback->onError(new blink::WebPresentationError(
- GetWebPresentationErrorTypeFromMojo(error->errorType),
+ GetWebPresentationErrorTypeFromMojo(error->error_type),
blink::WebString::fromUTF8(error->message)));
return;
}
« no previous file with comments | « content/renderer/presentation/presentation_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698