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

Side by Side Diff: content/browser/presentation/presentation_service_impl.cc

Issue 2972933002: [Media Router] Move main frame check for SetDefaultPresentationUrls. (Closed)
Patch Set: Rebase Created 3 years, 5 months 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
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 "content/browser/presentation/presentation_service_impl.h" 5 #include "content/browser/presentation/presentation_service_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 DCHECK(it->second.get()); 292 DCHECK(it->second.get());
293 it->second->Run(presentation_info, error); 293 it->second->Run(presentation_info, error);
294 pending_reconnect_presentation_cbs_.erase(it); 294 pending_reconnect_presentation_cbs_.erase(it);
295 return true; 295 return true;
296 } 296 }
297 297
298 void PresentationServiceImpl::SetDefaultPresentationUrls( 298 void PresentationServiceImpl::SetDefaultPresentationUrls(
299 const std::vector<GURL>& presentation_urls) { 299 const std::vector<GURL>& presentation_urls) {
300 DVLOG(2) << "SetDefaultPresentationUrls"; 300 DVLOG(2) << "SetDefaultPresentationUrls";
301 if (!controller_delegate_) 301 if (!controller_delegate_ || !is_main_frame_)
302 return; 302 return;
303 303
304 if (default_presentation_urls_ == presentation_urls) 304 if (default_presentation_urls_ == presentation_urls)
305 return; 305 return;
306 306
307 default_presentation_urls_ = presentation_urls; 307 default_presentation_urls_ = presentation_urls;
308 controller_delegate_->SetDefaultPresentationUrls( 308 controller_delegate_->SetDefaultPresentationUrls(
309 render_process_id_, render_frame_id_, presentation_urls, 309 render_process_id_, render_frame_id_, presentation_urls,
310 base::Bind(&PresentationServiceImpl::OnDefaultPresentationStarted, 310 base::Bind(&PresentationServiceImpl::OnDefaultPresentationStarted,
311 weak_factory_.GetWeakPtr())); 311 weak_factory_.GetWeakPtr()));
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } 494 }
495 495
496 void PresentationServiceImpl::NewPresentationCallbackWrapper::Run( 496 void PresentationServiceImpl::NewPresentationCallbackWrapper::Run(
497 const base::Optional<PresentationInfo>& presentation_info, 497 const base::Optional<PresentationInfo>& presentation_info,
498 const base::Optional<PresentationError>& error) { 498 const base::Optional<PresentationError>& error) {
499 DCHECK(!callback_.is_null()); 499 DCHECK(!callback_.is_null());
500 std::move(callback_).Run(presentation_info, error); 500 std::move(callback_).Run(presentation_info, error);
501 } 501 }
502 502
503 } // namespace content 503 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698