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

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

Issue 1149293008: [MediaRouter] Adds GetPresentationServiceDelegate impl to ChromeContentBrowserClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « chrome/browser/media/router/presentation_service_delegate_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/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 8
9 #include "base/containers/scoped_ptr_hash_map.h" 9 #include "base/containers/scoped_ptr_hash_map.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 scoped_ptr<PresentationFrame>( 320 scoped_ptr<PresentationFrame>(
321 new PresentationFrame(web_contents_, router_))); 321 new PresentationFrame(web_contents_, router_)));
322 } 322 }
323 return presentation_frames_.get(render_frame_host_id); 323 return presentation_frames_.get(render_frame_host_id);
324 } 324 }
325 325
326 void PresentationFrameManager::SetMediaRouterForTest(MediaRouter* router) { 326 void PresentationFrameManager::SetMediaRouterForTest(MediaRouter* router) {
327 router_ = router; 327 router_ = router;
328 } 328 }
329 329
330 PresentationServiceDelegateImpl*
331 PresentationServiceDelegateImpl::GetOrCreateForWebContents(
332 content::WebContents* web_contents) {
333 DCHECK(web_contents);
334 // CreateForWebContents does nothing if the delegate instance already exists.
335 PresentationServiceDelegateImpl::CreateForWebContents(web_contents);
336 return PresentationServiceDelegateImpl::FromWebContents(web_contents);
337 }
338
330 PresentationServiceDelegateImpl::PresentationServiceDelegateImpl( 339 PresentationServiceDelegateImpl::PresentationServiceDelegateImpl(
331 content::WebContents* web_contents) 340 content::WebContents* web_contents)
332 : web_contents_(web_contents), 341 : web_contents_(web_contents),
333 router_(MediaRouterMojoImplFactory::GetApiForBrowserContext( 342 router_(MediaRouterMojoImplFactory::GetApiForBrowserContext(
334 web_contents_->GetBrowserContext())), 343 web_contents_->GetBrowserContext())),
335 frame_manager_(new PresentationFrameManager(web_contents, router_)), 344 frame_manager_(new PresentationFrameManager(web_contents, router_)),
336 weak_factory_(this) { 345 weak_factory_(this) {
337 DCHECK(web_contents_); 346 DCHECK(web_contents_);
338 DCHECK(router_); 347 DCHECK(router_);
339 } 348 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( 515 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest(
507 int render_process_id, 516 int render_process_id,
508 int render_frame_id, 517 int render_frame_id,
509 const MediaSource::Id& source_id) const { 518 const MediaSource::Id& source_id) const {
510 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); 519 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
511 return frame_manager_->HasScreenAvailabilityListenerForTest( 520 return frame_manager_->HasScreenAvailabilityListenerForTest(
512 render_frame_host_id, source_id); 521 render_frame_host_id, source_id);
513 } 522 }
514 523
515 } // namespace media_router 524 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/presentation_service_delegate_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698