| Index: chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| index 57b7ee0ad44cf22fd0134fe4d78a19e86f19357e..09de4998d6061d9cbe3f856163cdb1f0db985af2 100644
|
| --- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| +++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
|
| @@ -662,14 +662,20 @@ void PresentationServiceDelegateImpl::Reset(int render_process_id,
|
| frame_manager_->Reset(render_frame_host_id);
|
| }
|
|
|
| -void PresentationServiceDelegateImpl::SetDefaultPresentationUrl(
|
| +void PresentationServiceDelegateImpl::SetDefaultPresentationUrls(
|
| int render_process_id,
|
| int render_frame_id,
|
| - const std::string& default_presentation_url,
|
| + const std::vector<std::string>& default_presentation_urls,
|
| const content::PresentationSessionStartedCallback& callback) {
|
| RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
|
| - frame_manager_->SetDefaultPresentationUrl(render_frame_host_id,
|
| - default_presentation_url, callback);
|
| + if (default_presentation_urls.empty()) {
|
| + frame_manager_->SetDefaultPresentationUrl(render_frame_host_id,
|
| + std::string(), callback);
|
| + } else {
|
| + // TODO(crbug.com/627655): Handle multiple URLs.
|
| + frame_manager_->SetDefaultPresentationUrl(
|
| + render_frame_host_id, default_presentation_urls[0], callback);
|
| + }
|
| }
|
|
|
| void PresentationServiceDelegateImpl::OnJoinRouteResponse(
|
| @@ -714,9 +720,17 @@ void PresentationServiceDelegateImpl::OnStartSessionSucceeded(
|
| void PresentationServiceDelegateImpl::StartSession(
|
| int render_process_id,
|
| int render_frame_id,
|
| - const std::string& presentation_url,
|
| + const std::vector<std::string>& presentation_urls,
|
| const content::PresentationSessionStartedCallback& success_cb,
|
| const content::PresentationSessionErrorCallback& error_cb) {
|
| + if (presentation_urls.empty()) {
|
| + error_cb.Run(content::PresentationError(content::PRESENTATION_ERROR_UNKNOWN,
|
| + "Invalid presentation arguments."));
|
| + return;
|
| + }
|
| +
|
| + // TODO(crbug.com/627655): Handle multiple URLs.
|
| + const std::string& presentation_url = presentation_urls[0];
|
| if (presentation_url.empty() || !IsValidPresentationUrl(presentation_url)) {
|
| error_cb.Run(content::PresentationError(content::PRESENTATION_ERROR_UNKNOWN,
|
| "Invalid presentation arguments."));
|
| @@ -745,10 +759,18 @@ void PresentationServiceDelegateImpl::StartSession(
|
| void PresentationServiceDelegateImpl::JoinSession(
|
| int render_process_id,
|
| int render_frame_id,
|
| - const std::string& presentation_url,
|
| + const std::vector<std::string>& presentation_urls,
|
| const std::string& presentation_id,
|
| const content::PresentationSessionStartedCallback& success_cb,
|
| const content::PresentationSessionErrorCallback& error_cb) {
|
| + if (presentation_urls.empty()) {
|
| + error_cb.Run(content::PresentationError(
|
| + content::PRESENTATION_ERROR_NO_PRESENTATION_FOUND,
|
| + "Invalid presentation arguments."));
|
| + }
|
| +
|
| + // TODO(crbug.com/627655): Handle multiple URLs.
|
| + const std::string& presentation_url = presentation_urls[0];
|
| bool incognito = web_contents_->GetBrowserContext()->IsOffTheRecord();
|
| std::vector<MediaRouteResponseCallback> route_response_callbacks;
|
| route_response_callbacks.push_back(base::Bind(
|
|
|