Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Side by Side Diff: chrome/browser/media/router/presentation_request.h

Issue 2386633003: [Media Router] Convert MediaRouter to use GURL for presentation URLs. (Closed)
Patch Set: Respond to dcheng@ comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <vector>
10 10
11 #include "chrome/browser/media/router/media_source.h" 11 #include "chrome/browser/media/router/media_source.h"
12 #include "chrome/browser/media/router/render_frame_host_id.h" 12 #include "chrome/browser/media/router/render_frame_host_id.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace media_router { 15 namespace media_router {
16 16
17 // Represents a presentation request made from a render frame. Contains the 17 // Represents a presentation request made from a render frame. Contains the
18 // presentation URL of the request, and information on the originating frame. 18 // presentation URL of the request, and information on the originating frame.
19 class PresentationRequest { 19 class PresentationRequest {
20 public: 20 public:
21 PresentationRequest(const RenderFrameHostId& render_frame_host_id, 21 PresentationRequest(const RenderFrameHostId& render_frame_host_id,
22 const std::vector<std::string>& presentation_urls, 22 const std::vector<GURL>& presentation_urls,
23 const GURL& frame_url); 23 const GURL& frame_url);
24 PresentationRequest(const PresentationRequest& other); 24 PresentationRequest(const PresentationRequest& other);
25 ~PresentationRequest(); 25 ~PresentationRequest();
26 26
27 bool Equals(const PresentationRequest& other) const; 27 bool Equals(const PresentationRequest& other) const;
28 28
29 // Helper method to get the MediaSources for |presentation_urls_|. 29 // Helper method to get the MediaSources for |presentation_urls_|.
30 std::vector<MediaSource> GetMediaSources() const; 30 std::vector<MediaSource> GetMediaSources() const;
31 31
32 const RenderFrameHostId& render_frame_host_id() const { 32 const RenderFrameHostId& render_frame_host_id() const {
33 return render_frame_host_id_; 33 return render_frame_host_id_;
34 } 34 }
35 // TODO(crbug.com/627655): Use multiple URLs. 35 // TODO(crbug.com/627655): Use multiple URLs.
36 const std::string& presentation_url() const { return presentation_urls_[0]; } 36 const GURL& presentation_url() const { return presentation_urls_[0]; }
37 const GURL& frame_url() const { return frame_url_; } 37 const GURL& frame_url() const { return frame_url_; }
38 38
39 private: 39 private:
40 // ID of RenderFrameHost that initiated the request. 40 // ID of RenderFrameHost that initiated the request.
41 const RenderFrameHostId render_frame_host_id_; 41 const RenderFrameHostId render_frame_host_id_;
42 42
43 // URLs of presentation. 43 // URLs of presentation.
44 const std::vector<std::string> presentation_urls_; 44 const std::vector<GURL> presentation_urls_;
45 45
46 // URL of frame from which the request was initiated. 46 // URL of frame from which the request was initiated.
47 const GURL frame_url_; 47 const GURL frame_url_;
48 }; 48 };
49 49
50 } // namespace media_router 50 } // namespace media_router
51 51
52 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ 52 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698