Chromium Code Reviews| 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; |
| } |