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 "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 MediaRouterDialogControllerImpl::~MediaRouterDialogControllerImpl() { | 165 MediaRouterDialogControllerImpl::~MediaRouterDialogControllerImpl() { |
166 } | 166 } |
167 | 167 |
168 WebContents* MediaRouterDialogControllerImpl::GetMediaRouterDialog() const { | 168 WebContents* MediaRouterDialogControllerImpl::GetMediaRouterDialog() const { |
169 DCHECK(thread_checker_.CalledOnValidThread()); | 169 DCHECK(thread_checker_.CalledOnValidThread()); |
170 return dialog_observer_.get() ? dialog_observer_->web_contents() : nullptr; | 170 return dialog_observer_.get() ? dialog_observer_->web_contents() : nullptr; |
171 } | 171 } |
172 | 172 |
173 void MediaRouterDialogControllerImpl::SetMediaRouterAction( | 173 void MediaRouterDialogControllerImpl::SetMediaRouterAction( |
174 const base::WeakPtr<MediaRouterAction>& action) { | 174 const base::WeakPtr<MediaRouterAction>& action) { |
175 action_ = action; | 175 if (!action_) |
| 176 action_ = action; |
176 } | 177 } |
177 | 178 |
178 bool MediaRouterDialogControllerImpl::IsShowingMediaRouterDialog() const { | 179 bool MediaRouterDialogControllerImpl::IsShowingMediaRouterDialog() const { |
179 return GetMediaRouterDialog() != nullptr; | 180 return GetMediaRouterDialog() != nullptr; |
180 } | 181 } |
181 | 182 |
182 void MediaRouterDialogControllerImpl::CloseMediaRouterDialog() { | 183 void MediaRouterDialogControllerImpl::CloseMediaRouterDialog() { |
183 WebContents* media_router_dialog = GetMediaRouterDialog(); | 184 WebContents* media_router_dialog = GetMediaRouterDialog(); |
184 if (!media_router_dialog) | 185 if (!media_router_dialog) |
185 return; | 186 return; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 ->GetWeakPtr(); | 292 ->GetWeakPtr(); |
292 if (!create_connection_request.get()) { | 293 if (!create_connection_request.get()) { |
293 media_router_ui->InitWithDefaultMediaSource(delegate); | 294 media_router_ui->InitWithDefaultMediaSource(delegate); |
294 } else { | 295 } else { |
295 media_router_ui->InitWithPresentationSessionRequest( | 296 media_router_ui->InitWithPresentationSessionRequest( |
296 initiator(), delegate, create_connection_request.Pass()); | 297 initiator(), delegate, create_connection_request.Pass()); |
297 } | 298 } |
298 } | 299 } |
299 | 300 |
300 } // namespace media_router | 301 } // namespace media_router |
OLD | NEW |