| 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 <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 DCHECK(media_router_dialog); | 304 DCHECK(media_router_dialog); |
| 305 if (!initiator() || !media_router_dialog->GetWebUI()) { | 305 if (!initiator() || !media_router_dialog->GetWebUI()) { |
| 306 Reset(); | 306 Reset(); |
| 307 return; | 307 return; |
| 308 } | 308 } |
| 309 | 309 |
| 310 MediaRouterUI* media_router_ui = static_cast<MediaRouterUI*>( | 310 MediaRouterUI* media_router_ui = static_cast<MediaRouterUI*>( |
| 311 media_router_dialog->GetWebUI()->GetController()); | 311 media_router_dialog->GetWebUI()->GetController()); |
| 312 DCHECK(media_router_ui); | 312 DCHECK(media_router_ui); |
| 313 | 313 |
| 314 scoped_ptr<CreatePresentationConnectionRequest> create_connection_request( | 314 std::unique_ptr<CreatePresentationConnectionRequest> |
| 315 TakeCreateConnectionRequest()); | 315 create_connection_request(TakeCreateConnectionRequest()); |
| 316 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't | 316 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't |
| 317 // exist (crbug.com/508695). | 317 // exist (crbug.com/508695). |
| 318 base::WeakPtr<PresentationServiceDelegateImpl> delegate = | 318 base::WeakPtr<PresentationServiceDelegateImpl> delegate = |
| 319 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) | 319 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) |
| 320 ->GetWeakPtr(); | 320 ->GetWeakPtr(); |
| 321 if (!create_connection_request.get()) { | 321 if (!create_connection_request.get()) { |
| 322 media_router_ui->InitWithDefaultMediaSource(delegate); | 322 media_router_ui->InitWithDefaultMediaSource(delegate); |
| 323 } else { | 323 } else { |
| 324 media_router_ui->InitWithPresentationSessionRequest( | 324 media_router_ui->InitWithPresentationSessionRequest( |
| 325 initiator(), delegate, std::move(create_connection_request)); | 325 initiator(), delegate, std::move(create_connection_request)); |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace media_router | 329 } // namespace media_router |
| OLD | NEW |