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

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: Added handling for overlapping requests, default presentation id, 1-UA fallback 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
Index: content/renderer/presentation/presentation_dispatcher.cc
diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc
index 88236345a26ab374f4a9fdc7ca6ee917ba8fb7b5..d6d7170963722e133a07db5469faab5137147503 100644
--- a/content/renderer/presentation/presentation_dispatcher.cc
+++ b/content/renderer/presentation/presentation_dispatcher.cc
@@ -56,14 +56,20 @@ void PresentationDispatcher::setController(
}
void PresentationDispatcher::updateAvailableChangeWatched(bool watched) {
+ DoUpdateAvailableChangeWatched(std::string(), watched);
whywhat 2015/03/13 17:44:35 note: string() should be replaced with GetPresenta
imcheng 2015/03/13 23:36:46 Acknowledged.
+}
+
+void PresentationDispatcher::DoUpdateAvailableChangeWatched(
+ const std::string& presentation_url, bool watched) {
ConnectToPresentationServiceIfNeeded();
if (watched) {
presentation_service_->GetScreenAvailability(
- mojo::String(),
+ presentation_url,
base::Bind(&PresentationDispatcher::OnScreenAvailabilityChanged,
base::Unretained(this)));
} else {
- presentation_service_->OnScreenAvailabilityListenerRemoved();
+ presentation_service_->OnScreenAvailabilityListenerRemoved(
+ presentation_url);
}
}
@@ -103,12 +109,14 @@ void PresentationDispatcher::joinSession(
base::Owned(callback)));
}
-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);
}
@@ -121,7 +129,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;
}

Powered by Google App Engine
This is Rietveld 408576698