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

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

Issue 2678123003: Revert of Convert MediaRouter mojom apis to intake url::Origin objects instead of strings (Closed)
Patch Set: Created 3 years, 10 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/origin.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<GURL>& presentation_urls, 22 const std::vector<GURL>& presentation_urls,
23 const url::Origin& frame_origin); 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 const std::vector<GURL>& presentation_urls() const { 35 const std::vector<GURL>& presentation_urls() const {
36 return presentation_urls_; 36 return presentation_urls_;
37 } 37 }
38 const url::Origin& frame_origin() const { return frame_origin_; } 38 const GURL& frame_url() const { return frame_url_; }
39 39
40 private: 40 private:
41 // ID of RenderFrameHost that initiated the request. 41 // ID of RenderFrameHost that initiated the request.
42 const RenderFrameHostId render_frame_host_id_; 42 const RenderFrameHostId render_frame_host_id_;
43 43
44 // URLs of presentation. 44 // URLs of presentation.
45 const std::vector<GURL> presentation_urls_; 45 const std::vector<GURL> presentation_urls_;
46 46
47 // Origin of frame from which the request was initiated. 47 // URL of frame from which the request was initiated.
48 const url::Origin frame_origin_; 48 // TODO(crbug.com/632623): Convert this to url::Origin as only the origin or
49 // hostname is used.
50 const GURL frame_url_;
49 }; 51 };
50 52
51 } // namespace media_router 53 } // namespace media_router
52 54
53 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_ 55 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698