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

Side by Side Diff: chrome/browser/media/router/presentation_service_delegate_impl.cc

Issue 2264153002: [Presentation API] Add support for multiple URLs in PresentationRequest on Media Router UI side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify MediaRouterDialogControllerAndroid, format Created 4 years, 3 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 "chrome/browser/media/router/presentation_service_delegate_impl.h" 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 const std::string& default_presentation_url, 541 const std::string& default_presentation_url,
542 const content::PresentationSessionStartedCallback& callback) { 542 const content::PresentationSessionStartedCallback& callback) {
543 if (!IsMainFrame(render_frame_host_id)) 543 if (!IsMainFrame(render_frame_host_id))
544 return; 544 return;
545 545
546 if (default_presentation_url.empty()) { 546 if (default_presentation_url.empty()) {
547 ClearDefaultPresentationRequest(); 547 ClearDefaultPresentationRequest();
548 } else { 548 } else {
549 DCHECK(!callback.is_null()); 549 DCHECK(!callback.is_null());
550 GURL frame_url(GetLastCommittedURLForFrame(render_frame_host_id)); 550 GURL frame_url(GetLastCommittedURLForFrame(render_frame_host_id));
551 PresentationRequest request(render_frame_host_id, default_presentation_url, 551 PresentationRequest request(render_frame_host_id,
552 frame_url); 552 {default_presentation_url}, frame_url);
553 default_presentation_started_callback_ = callback; 553 default_presentation_started_callback_ = callback;
554 SetDefaultPresentationRequest(request); 554 SetDefaultPresentationRequest(request);
555 } 555 }
556 } 556 }
557 557
558 void PresentationFrameManager::AddDelegateObserver( 558 void PresentationFrameManager::AddDelegateObserver(
559 const RenderFrameHostId& render_frame_host_id, 559 const RenderFrameHostId& render_frame_host_id,
560 DelegateObserver* observer) { 560 DelegateObserver* observer) {
561 auto* presentation_frame = GetOrAddPresentationFrame(render_frame_host_id); 561 auto* presentation_frame = GetOrAddPresentationFrame(render_frame_host_id);
562 presentation_frame->set_delegate_observer(observer); 562 presentation_frame->set_delegate_observer(observer);
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( 960 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest(
961 int render_process_id, 961 int render_process_id,
962 int render_frame_id, 962 int render_frame_id,
963 const MediaSource::Id& source_id) const { 963 const MediaSource::Id& source_id) const {
964 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); 964 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
965 return frame_manager_->HasScreenAvailabilityListenerForTest( 965 return frame_manager_->HasScreenAvailabilityListenerForTest(
966 render_frame_host_id, source_id); 966 render_frame_host_id, source_id);
967 } 967 }
968 968
969 } // namespace media_router 969 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698