Chromium Code Reviews| 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), |