| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/media/router/presentation_request.h" | 5 #include "chrome/browser/media/router/presentation_request.h" |
| 6 | 6 |
| 7 #include "chrome/browser/media/router/media_source_helper.h" | 7 #include "chrome/browser/media/router/media_source_helper.h" |
| 8 | 8 |
| 9 namespace media_router { | 9 namespace media_router { |
| 10 | 10 |
| 11 PresentationRequest::PresentationRequest( | 11 PresentationRequest::PresentationRequest( |
| 12 const RenderFrameHostId& render_frame_host_id, | 12 const RenderFrameHostId& render_frame_host_id, |
| 13 const std::string& presentation_url, | 13 const std::string& presentation_url, |
| 14 const GURL& frame_url) | 14 const GURL& frame_url) |
| 15 : render_frame_host_id_(render_frame_host_id), | 15 : render_frame_host_id_(render_frame_host_id), |
| 16 presentation_url_(presentation_url), | 16 presentation_urls_({presentation_url}), |
| 17 frame_url_(frame_url) {} | 17 frame_url_(frame_url) {} |
| 18 | 18 |
| 19 PresentationRequest::PresentationRequest(const PresentationRequest& other) = | 19 PresentationRequest::PresentationRequest(const PresentationRequest& other) = |
| 20 default; | 20 default; |
| 21 | 21 |
| 22 PresentationRequest::~PresentationRequest() = default; | 22 PresentationRequest::~PresentationRequest() = default; |
| 23 | 23 |
| 24 bool PresentationRequest::Equals(const PresentationRequest& other) const { | 24 bool PresentationRequest::Equals(const PresentationRequest& other) const { |
| 25 return render_frame_host_id_ == other.render_frame_host_id_ && | 25 return render_frame_host_id_ == other.render_frame_host_id_ && |
| 26 presentation_url_ == other.presentation_url_ && | 26 presentation_urls_ == other.presentation_urls_ && |
| 27 frame_url_ == other.frame_url_; | 27 frame_url_ == other.frame_url_; |
| 28 } | 28 } |
| 29 | 29 |
| 30 MediaSource PresentationRequest::GetMediaSource() const { | 30 std::vector<MediaSource> PresentationRequest::GetMediaSources() const { |
| 31 return MediaSourceForPresentationUrl(presentation_url_); | 31 std::vector<MediaSource> sources; |
| 32 for (const std::string& presentation_url : presentation_urls_) |
| 33 sources.push_back(MediaSourceForPresentationUrl(presentation_url)); |
| 34 return sources; |
| 32 } | 35 } |
| 33 | 36 |
| 34 } // namespace media_router | 37 } // namespace media_router |
| OLD | NEW |