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

Unified Diff: chrome/browser/media/router/presentation_request.h

Issue 1406013003: [Presentation API / Media Router] Clean up default pres URL logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments #20, #22 Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/presentation_request.h
diff --git a/chrome/browser/media/router/presentation_request.h b/chrome/browser/media/router/presentation_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..a37189f71831a02e3d7c0f37d593f85088cf7c1e
--- /dev/null
+++ b/chrome/browser/media/router/presentation_request.h
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_
+
+#include <string>
+
+#include "chrome/browser/media/router/media_source.h"
+#include "chrome/browser/media/router/render_frame_host_id.h"
+#include "url/gurl.h"
+
+namespace media_router {
+
+// Represents a presentation request made from a render frame. Contains the
+// presentation URL of the request, and information on the originating frame.
mark a. foltz 2015/11/09 18:33:35 Should this also take the tab id to pass to the MR
imcheng 2015/11/10 18:49:13 It can be obtained via initiator WebContents avail
+class PresentationRequest {
+ public:
+ PresentationRequest(const RenderFrameHostId& render_frame_host_id,
+ const std::string& presentation_url,
+ const GURL& frame_url);
+ ~PresentationRequest();
+
+ bool Equals(const PresentationRequest& other) const;
+
+ // Helper method to get the MediaSource for |presentation_url_|.
+ MediaSource GetMediaSource() const;
+
+ const RenderFrameHostId& render_frame_host_id() const {
+ return render_frame_host_id_;
+ }
+ const std::string& presentation_url() const { return presentation_url_; }
+ const GURL& frame_url() const { return frame_url_; }
+
+ private:
+ // ID of RenderFrameHost that initiated the request.
+ const RenderFrameHostId render_frame_host_id_;
+
+ // URL of presentation.
+ const std::string presentation_url_;
+
+ // URL of frame from which the request was initiated.
+ const GURL frame_url_;
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_REQUEST_H_

Powered by Google App Engine
This is Rietveld 408576698