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/ui/webui/media_router/media_router_dialog_controller_im
pl.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im
pl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 10 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 | 268 |
269 MediaRouterUI* media_router_ui = static_cast<MediaRouterUI*>( | 269 MediaRouterUI* media_router_ui = static_cast<MediaRouterUI*>( |
270 media_router_dialog->GetWebUI()->GetController()); | 270 media_router_dialog->GetWebUI()->GetController()); |
271 DCHECK(media_router_ui); | 271 DCHECK(media_router_ui); |
272 if (!media_router_ui) { | 272 if (!media_router_ui) { |
273 Reset(); | 273 Reset(); |
274 return; | 274 return; |
275 } | 275 } |
276 | 276 |
277 scoped_ptr<CreatePresentationConnectionRequest> create_connection_request( | 277 scoped_ptr<CreatePresentationSessionRequest> presentation_request( |
278 TakeCreateConnectionRequest()); | 278 TakePresentationRequest()); |
279 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't | 279 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't |
280 // exist (crbug.com/508695). | 280 // exist (crbug.com/508695). |
281 base::WeakPtr<PresentationServiceDelegateImpl> delegate = | 281 base::WeakPtr<PresentationServiceDelegateImpl> delegate = |
282 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) | 282 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) |
283 ->GetWeakPtr(); | 283 ->GetWeakPtr(); |
284 if (!create_connection_request.get()) { | 284 if (!presentation_request.get()) { |
285 media_router_ui->InitWithDefaultMediaSource(delegate); | 285 media_router_ui->InitWithDefaultMediaSource(delegate); |
286 } else { | 286 } else { |
287 media_router_ui->InitWithPresentationSessionRequest( | 287 media_router_ui->InitWithPresentationSessionRequest( |
288 initiator(), delegate, create_connection_request.Pass()); | 288 initiator(), delegate, presentation_request.Pass()); |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
292 } // namespace media_router | 292 } // namespace media_router |
OLD | NEW |