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

Unified Diff: chrome/browser/media/router/create_presentation_connection_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: Original patch 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/create_presentation_connection_request.h
diff --git a/chrome/browser/media/router/create_presentation_session_request.h b/chrome/browser/media/router/create_presentation_connection_request.h
similarity index 73%
rename from chrome/browser/media/router/create_presentation_session_request.h
rename to chrome/browser/media/router/create_presentation_connection_request.h
index 9cebcb9aabc8a8d0644db629eea410567e462026..024dd1bcfdd60b226a3d3294b082d63621eee047 100644
--- a/chrome/browser/media/router/create_presentation_session_request.h
+++ b/chrome/browser/media/router/create_presentation_connection_request.h
@@ -2,13 +2,16 @@
// 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_CREATE_PRESENTATION_SESSION_REQUEST_H_
-#define CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_
#include <string>
+#include "base/macros.h"
#include "chrome/browser/media/router/media_route.h"
#include "chrome/browser/media/router/media_source.h"
+#include "chrome/browser/media/router/presentation_request.h"
+#include "chrome/browser/media/router/render_frame_host_id.h"
#include "content/public/browser/presentation_service_delegate.h"
#include "url/gurl.h"
@@ -25,28 +28,29 @@ namespace media_router {
// MediaRouterUI. |success_cb| will be invoked when create-session
// succeeds, or |error_cb| will be invoked when create-session fails or
// the UI closes.
-class CreatePresentationSessionRequest {
+class CreatePresentationConnectionRequest {
public:
using PresentationSessionSuccessCallback =
base::Callback<void(const content::PresentationSessionInfo&,
const MediaRoute::Id&)>;
using PresentationSessionErrorCallback =
- content::PresentationServiceDelegate::PresentationSessionErrorCallback;
-
+ content::PresentationSessionErrorCallback;
// |presentation_url|: The presentation URL of the request. Must be a valid
// URL.
// |frame_url|: The URL of the frame that initiated the presentation request.
// |success_cb|: Callback to invoke when the request succeeds. Must be valid.
// |erorr_cb|: Callback to invoke when the request fails. Must be valid.
- CreatePresentationSessionRequest(
+ CreatePresentationConnectionRequest(
+ const RenderFrameHostId& render_frame_host_id,
const std::string& presentation_url,
const GURL& frame_url,
const PresentationSessionSuccessCallback& success_cb,
const PresentationSessionErrorCallback& error_cb);
- ~CreatePresentationSessionRequest();
+ ~CreatePresentationConnectionRequest();
- const MediaSource& media_source() const { return media_source_; }
- const GURL& frame_url() const { return frame_url_; }
+ const PresentationRequest& presentation_request() const {
+ return presentation_request_;
+ }
// Invokes |success_cb_| or |error_cb_| with the given arguments.
// These functions can only be invoked once per instance. It is an error
@@ -57,21 +61,20 @@ class CreatePresentationSessionRequest {
// Handle route creation/joining response by invoking the right callback.
static void HandleRouteResponse(
- scoped_ptr<CreatePresentationSessionRequest> presentation_request,
+ scoped_ptr<CreatePresentationConnectionRequest> presentation_request,
const MediaRoute* route,
const std::string& presentation_id,
const std::string& error);
private:
- const MediaSource media_source_;
- const GURL frame_url_;
+ const PresentationRequest presentation_request_;
PresentationSessionSuccessCallback success_cb_;
PresentationSessionErrorCallback error_cb_;
bool cb_invoked_;
- DISALLOW_COPY_AND_ASSIGN(CreatePresentationSessionRequest);
+ DISALLOW_COPY_AND_ASSIGN(CreatePresentationConnectionRequest);
};
} // namespace media_router
-#endif // CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_
+#endif // CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_

Powered by Google App Engine
This is Rietveld 408576698