Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | |
| 9 | 10 |
| 10 #include "chrome/browser/media/router/media_source.h" | 11 #include "chrome/browser/media/router/media_source.h" |
| 11 #include "chrome/browser/media/router/render_frame_host_id.h" | 12 #include "chrome/browser/media/router/render_frame_host_id.h" |
| 12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 13 | 14 |
| 14 namespace media_router { | 15 namespace media_router { |
| 15 | 16 |
| 16 // Represents a presentation request made from a render frame. Contains the | 17 // Represents a presentation request made from a render frame. Contains the |
| 17 // presentation URL of the request, and information on the originating frame. | 18 // presentation URL of the request, and information on the originating frame. |
| 18 class PresentationRequest { | 19 class PresentationRequest { |
| 19 public: | 20 public: |
| 20 PresentationRequest(const RenderFrameHostId& render_frame_host_id, | 21 PresentationRequest(const RenderFrameHostId& render_frame_host_id, |
| 22 // TODO(crbug.com/627655): Handle multiple URLs. | |
|
mark a. foltz
2016/08/31 05:18:54
Would it be possible to change the ctor to take co
takumif
2016/09/01 21:09:25
Done.
| |
| 21 const std::string& presentation_url, | 23 const std::string& presentation_url, |
| 22 const GURL& frame_url); | 24 const GURL& frame_url); |
| 23 PresentationRequest(const PresentationRequest& other); | 25 PresentationRequest(const PresentationRequest& other); |
| 24 ~PresentationRequest(); | 26 ~PresentationRequest(); |
| 25 | 27 |
| 26 bool Equals(const PresentationRequest& other) const; | 28 bool Equals(const PresentationRequest& other) const; |
| 27 | 29 |
| 28 // Helper method to get the MediaSource for |presentation_url_|. | 30 // Helper method to get the MediaSources for |presentation_urls_|. |
| 29 MediaSource GetMediaSource() const; | 31 std::vector<MediaSource> GetMediaSources() const; |
| 30 | 32 |
| 31 const RenderFrameHostId& render_frame_host_id() const { | 33 const RenderFrameHostId& render_frame_host_id() const { |
| 32 return render_frame_host_id_; | 34 return render_frame_host_id_; |
| 33 } | 35 } |
| 34 const std::string& presentation_url() const { return presentation_url_; } | 36 // TODO(crbug.com/627655): Use multiple URLs. |
| 37 const std::string& presentation_url() const { return presentation_urls_[0]; } | |
| 35 const GURL& frame_url() const { return frame_url_; } | 38 const GURL& frame_url() const { return frame_url_; } |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 // ID of RenderFrameHost that initiated the request. | 41 // ID of RenderFrameHost that initiated the request. |
| 39 const RenderFrameHostId render_frame_host_id_; | 42 const RenderFrameHostId render_frame_host_id_; |
| 40 | 43 |
| 41 // URL of presentation. | 44 // URLs of presentation. |
| 42 const std::string presentation_url_; | 45 const std::vector<std::string> presentation_urls_; |
| 43 | 46 |
| 44 // URL of frame from which the request was initiated. | 47 // URL of frame from which the request was initiated. |
| 45 const GURL frame_url_; | 48 const GURL frame_url_; |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 } // namespace media_router | 51 } // namespace media_router |
| 49 | 52 |
| 50 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ | 53 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ |
| OLD | NEW |