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 <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 14 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/toolbar/media_router_action.h" | 16 #include "chrome/browser/ui/toolbar/media_router_action.h" |
16 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 17 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
17 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" | 18 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 TakeCreateConnectionRequest()); | 296 TakeCreateConnectionRequest()); |
296 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't | 297 // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't |
297 // exist (crbug.com/508695). | 298 // exist (crbug.com/508695). |
298 base::WeakPtr<PresentationServiceDelegateImpl> delegate = | 299 base::WeakPtr<PresentationServiceDelegateImpl> delegate = |
299 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) | 300 PresentationServiceDelegateImpl::GetOrCreateForWebContents(initiator()) |
300 ->GetWeakPtr(); | 301 ->GetWeakPtr(); |
301 if (!create_connection_request.get()) { | 302 if (!create_connection_request.get()) { |
302 media_router_ui->InitWithDefaultMediaSource(delegate); | 303 media_router_ui->InitWithDefaultMediaSource(delegate); |
303 } else { | 304 } else { |
304 media_router_ui->InitWithPresentationSessionRequest( | 305 media_router_ui->InitWithPresentationSessionRequest( |
305 initiator(), delegate, create_connection_request.Pass()); | 306 initiator(), delegate, std::move(create_connection_request)); |
306 } | 307 } |
307 } | 308 } |
308 | 309 |
309 } // namespace media_router | 310 } // namespace media_router |
OLD | NEW |