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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 MediaRouterDialogControllerImpl::~MediaRouterDialogControllerImpl() { | 166 MediaRouterDialogControllerImpl::~MediaRouterDialogControllerImpl() { |
167 } | 167 } |
168 | 168 |
169 WebContents* MediaRouterDialogControllerImpl::GetMediaRouterDialog() const { | 169 WebContents* MediaRouterDialogControllerImpl::GetMediaRouterDialog() const { |
170 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 170 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
171 return dialog_observer_.get() ? dialog_observer_->web_contents() : nullptr; | 171 return dialog_observer_.get() ? dialog_observer_->web_contents() : nullptr; |
172 } | 172 } |
173 | 173 |
174 void MediaRouterDialogControllerImpl::SetMediaRouterAction( | 174 void MediaRouterDialogControllerImpl::SetMediaRouterAction( |
175 const base::WeakPtr<MediaRouterAction>& action) { | 175 const base::WeakPtr<MediaRouterAction>& action) { |
176 if (!action_) | 176 action_ = action; |
177 action_ = action; | |
178 } | 177 } |
179 | 178 |
180 bool MediaRouterDialogControllerImpl::IsShowingMediaRouterDialog() const { | 179 bool MediaRouterDialogControllerImpl::IsShowingMediaRouterDialog() const { |
181 return GetMediaRouterDialog() != nullptr; | 180 return GetMediaRouterDialog() != nullptr; |
182 } | 181 } |
183 | 182 |
184 void MediaRouterDialogControllerImpl::UpdateMaxDialogSize() { | 183 void MediaRouterDialogControllerImpl::UpdateMaxDialogSize() { |
185 WebContents* media_router_dialog = GetMediaRouterDialog(); | 184 WebContents* media_router_dialog = GetMediaRouterDialog(); |
186 if (!media_router_dialog) | 185 if (!media_router_dialog) |
187 return; | 186 return; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 ->GetWeakPtr(); | 318 ->GetWeakPtr(); |
320 if (!create_connection_request.get()) { | 319 if (!create_connection_request.get()) { |
321 media_router_ui->InitWithDefaultMediaSource(delegate); | 320 media_router_ui->InitWithDefaultMediaSource(delegate); |
322 } else { | 321 } else { |
323 media_router_ui->InitWithPresentationSessionRequest( | 322 media_router_ui->InitWithPresentationSessionRequest( |
324 initiator(), delegate, std::move(create_connection_request)); | 323 initiator(), delegate, std::move(create_connection_request)); |
325 } | 324 } |
326 } | 325 } |
327 | 326 |
328 } // namespace media_router | 327 } // namespace media_router |
OLD | NEW |