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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/presentation_service_delegate_impl.cc
diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc
index ebe434d4e8e8d01fd6607d8d7a32a5e352b74e62..5b7c04240e45f46d32690924ec65e2f3d3b4c004 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -327,6 +327,20 @@ void PresentationFrameManager::SetMediaRouterForTest(MediaRouter* router) {
router_ = router;
}
+PresentationServiceDelegateImpl*
+PresentationServiceDelegateImpl::GetOrCreateForWebContents(
+ content::WebContents* web_contents) {
+ DCHECK(web_contents);
+ PresentationServiceDelegateImpl* delegateImpl =
imcheng (use chromium acct) 2015/06/04 18:48:36 s/delegateImpl/delegate_impl
haibinlu 2015/06/04 20:25:45 Done.
+ PresentationServiceDelegateImpl::FromWebContents(web_contents);
imcheng (use chromium acct) 2015/06/04 18:48:36 You can just do the following: // No-ops if it al
haibinlu 2015/06/04 20:25:45 Done.
+ if (!delegateImpl) {
+ PresentationServiceDelegateImpl::CreateForWebContents(web_contents);
+ delegateImpl = PresentationServiceDelegateImpl::FromWebContents(
+ web_contents);
+ }
+ return delegateImpl;
+}
+
PresentationServiceDelegateImpl::PresentationServiceDelegateImpl(
content::WebContents* web_contents)
: web_contents_(web_contents),

Powered by Google App Engine
This is Rietveld 408576698