| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 MediaRouterUI* media_router_ui = static_cast<MediaRouterUI*>( | 255 MediaRouterUI* media_router_ui = static_cast<MediaRouterUI*>( |
| 256 media_router_dialog->GetWebUI()->GetController()); | 256 media_router_dialog->GetWebUI()->GetController()); |
| 257 DCHECK(media_router_ui); | 257 DCHECK(media_router_ui); |
| 258 if (!media_router_ui) { | 258 if (!media_router_ui) { |
| 259 Reset(); | 259 Reset(); |
| 260 return; | 260 return; |
| 261 } | 261 } |
| 262 | 262 |
| 263 scoped_ptr<CreatePresentationSessionRequest> presentation_request( | 263 scoped_ptr<CreatePresentationSessionRequest> presentation_request( |
| 264 PassPresentationRequest()); | 264 TakePresentationRequest()); |
| 265 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't | 265 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't |
| 266 // exist (crbug.com/508695). | 266 // exist (crbug.com/508695). |
| 267 base::WeakPtr<PresentationServiceDelegateImpl> delegate = | 267 base::WeakPtr<PresentationServiceDelegateImpl> delegate = |
| 268 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) | 268 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) |
| 269 ->GetWeakPtr(); | 269 ->GetWeakPtr(); |
| 270 if (!presentation_request.get()) { | 270 if (!presentation_request.get()) { |
| 271 media_router_ui->InitWithDefaultMediaSource(delegate); | 271 media_router_ui->InitWithDefaultMediaSource(delegate); |
| 272 } else { | 272 } else { |
| 273 media_router_ui->InitWithPresentationSessionRequest( | 273 media_router_ui->InitWithPresentationSessionRequest( |
| 274 initiator(), delegate, presentation_request.Pass()); | 274 initiator(), delegate, presentation_request.Pass()); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace media_router | 278 } // namespace media_router |
| 279 | 279 |
| OLD | NEW |