Index: content/renderer/presentation/presentation_dispatcher.cc |
diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc |
index e9360099ed0a640a7a16f30f4f2eec8e299407c5..45c4e74b482a3dbda81e2011ed5d1778ad733950 100644 |
--- a/content/renderer/presentation/presentation_dispatcher.cc |
+++ b/content/renderer/presentation/presentation_dispatcher.cc |
@@ -16,7 +16,7 @@ |
#include "content/renderer/presentation/presentation_connection_client.h" |
#include "services/shell/public/cpp/interface_provider.h" |
#include "third_party/WebKit/public/platform/WebString.h" |
-#include "third_party/WebKit/public/platform/WebURL.h" |
+#include "third_party/WebKit/public/platform/WebVector.h" |
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationAvailabilityObserver.h" |
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationController.h" |
#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationError.h" |
@@ -100,37 +100,42 @@ void PresentationDispatcher::setController( |
} |
void PresentationDispatcher::startSession( |
- const blink::WebString& presentationUrl, |
+ const blink::WebVector<blink::WebString>& presentationUrls, |
blink::WebPresentationConnectionClientCallbacks* callback) { |
DCHECK(callback); |
ConnectToPresentationServiceIfNeeded(); |
+ mojo::Array<mojo::String> urls(presentationUrls.size()); |
+ for (size_t i = 0; i < presentationUrls.size(); ++i) |
+ urls[i] = presentationUrls[i].utf8(); |
+ |
// The dispatcher owns the service so |this| will be valid when |
// OnSessionCreated() is called. |callback| needs to be alive and also needs |
// to be destroyed so we transfer its ownership to the mojo callback. |
presentation_service_->StartSession( |
- presentationUrl.utf8(), |
+ std::move(urls), |
base::Bind(&PresentationDispatcher::OnSessionCreated, |
- base::Unretained(this), |
- base::Owned(callback))); |
+ base::Unretained(this), base::Owned(callback))); |
} |
void PresentationDispatcher::joinSession( |
- const blink::WebString& presentationUrl, |
+ const blink::WebVector<blink::WebString>& presentationUrls, |
const blink::WebString& presentationId, |
blink::WebPresentationConnectionClientCallbacks* callback) { |
DCHECK(callback); |
ConnectToPresentationServiceIfNeeded(); |
+ mojo::Array<mojo::String> urls(presentationUrls.size()); |
+ for (size_t i = 0; i < presentationUrls.size(); ++i) |
+ urls[i] = presentationUrls[i].utf8(); |
+ |
// The dispatcher owns the service so |this| will be valid when |
// OnSessionCreated() is called. |callback| needs to be alive and also needs |
// to be destroyed so we transfer its ownership to the mojo callback. |
presentation_service_->JoinSession( |
- presentationUrl.utf8(), |
- presentationId.utf8(), |
+ std::move(urls), presentationId.utf8(), |
base::Bind(&PresentationDispatcher::OnSessionCreated, |
- base::Unretained(this), |
- base::Owned(callback))); |
+ base::Unretained(this), base::Owned(callback))); |
} |
void PresentationDispatcher::sendString( |
@@ -290,10 +295,14 @@ void PresentationDispatcher::stopListening( |
UpdateListeningState(status_it->second.get()); |
} |
-void PresentationDispatcher::setDefaultPresentationUrl( |
- const blink::WebString& url) { |
+void PresentationDispatcher::setDefaultPresentationUrls( |
+ const blink::WebVector<blink::WebString>& presentationUrls) { |
ConnectToPresentationServiceIfNeeded(); |
- presentation_service_->SetDefaultPresentationURL(url.utf8()); |
+ mojo::Array<mojo::String> urls(presentationUrls.size()); |
+ for (size_t i = 0; i < presentationUrls.size(); ++i) |
+ urls[i] = presentationUrls[i].utf8(); |
+ |
+ presentation_service_->SetDefaultPresentationUrls(std::move(urls)); |
} |
void PresentationDispatcher::DidCommitProvisionalLoad( |