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 #include "chrome/browser/media/router/create_presentation_connection_request.h" | 5 #include "chrome/browser/media/router/create_presentation_connection_request.h" |
6 | 6 |
7 #include "chrome/browser/media/router/media_source_helper.h" | 7 #include "chrome/browser/media/router/media_source_helper.h" |
8 #include "chrome/browser/media/router/route_request_result.h" | 8 #include "chrome/browser/media/router/route_request_result.h" |
| 9 #include "url/gurl.h" |
9 | 10 |
10 using content::PresentationSessionInfo; | 11 using content::PresentationSessionInfo; |
11 using content::PresentationError; | 12 using content::PresentationError; |
12 | 13 |
13 namespace media_router { | 14 namespace media_router { |
14 | 15 |
15 CreatePresentationConnectionRequest::CreatePresentationConnectionRequest( | 16 CreatePresentationConnectionRequest::CreatePresentationConnectionRequest( |
16 const RenderFrameHostId& render_frame_host_id, | 17 const RenderFrameHostId& render_frame_host_id, |
17 const std::string& presentation_url, | 18 const GURL& presentation_url, |
18 const GURL& frame_url, | 19 const GURL& frame_url, |
19 const PresentationSessionSuccessCallback& success_cb, | 20 const PresentationSessionSuccessCallback& success_cb, |
20 const PresentationSessionErrorCallback& error_cb) | 21 const PresentationSessionErrorCallback& error_cb) |
21 : presentation_request_(render_frame_host_id, | 22 : presentation_request_(render_frame_host_id, |
22 {presentation_url}, | 23 {presentation_url}, |
23 frame_url), | 24 frame_url), |
24 success_cb_(success_cb), | 25 success_cb_(success_cb), |
25 error_cb_(error_cb), | 26 error_cb_(error_cb), |
26 cb_invoked_(false) { | 27 cb_invoked_(false) { |
27 DCHECK(!success_cb.is_null()); | 28 DCHECK(!success_cb.is_null()); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (!result.route()) { | 65 if (!result.route()) { |
65 presentation_request->InvokeErrorCallback(content::PresentationError( | 66 presentation_request->InvokeErrorCallback(content::PresentationError( |
66 content::PRESENTATION_ERROR_UNKNOWN, result.error())); | 67 content::PRESENTATION_ERROR_UNKNOWN, result.error())); |
67 } else { | 68 } else { |
68 presentation_request->InvokeSuccessCallback( | 69 presentation_request->InvokeSuccessCallback( |
69 result.presentation_id(), result.route()->media_route_id()); | 70 result.presentation_id(), result.route()->media_route_id()); |
70 } | 71 } |
71 } | 72 } |
72 | 73 |
73 } // namespace media_router | 74 } // namespace media_router |
OLD | NEW |