Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc

Issue 1476053002: [Media Router] Only keep track of toolbar MediaRouterAction in MediaRouterDialogControllerImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698