Chromium Code Reviews| Index: chrome/browser/chrome_content_browser_client.cc |
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
| index dbfff0a06a54116bc6cf478efaabb8576e6d4d24..2ca4c7df4092046328a06850e92880f30c5ad4ff 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -351,6 +351,7 @@ |
| #if defined(ENABLE_MEDIA_ROUTER) |
| #include "chrome/browser/media/router/media_router_feature.h" |
| #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
| +#include "chrome/browser/media/router/receiver_presentation_service_delegate_impl.h" |
| #endif // defined(ENABLE_MEDIA_ROUTER) |
| #if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER) |
| @@ -3137,9 +3138,9 @@ void ChromeContentBrowserClient::OpenURL( |
| #endif |
| } |
| -content::PresentationServiceDelegate* |
| -ChromeContentBrowserClient::GetPresentationServiceDelegate( |
| - content::WebContents* web_contents) { |
| +content::ControllerPresentationServiceDelegate* |
| +ChromeContentBrowserClient::GetControllerPresentationServiceDelegate( |
| + content::WebContents* web_contents) { |
| #if defined(ENABLE_MEDIA_ROUTER) |
| if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
| return media_router::PresentationServiceDelegateImpl:: |
| @@ -3149,6 +3150,24 @@ ChromeContentBrowserClient::GetPresentationServiceDelegate( |
| return nullptr; |
| } |
| +content::ReceiverPresentationServiceDelegate* |
| +ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( |
| + content::WebContents* web_contents) { |
| +#if defined(ENABLE_MEDIA_ROUTER) |
| + if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) { |
| + // ReceiverPresentationServiceDelegateImpl exists only for WebContents |
| + // created for offscreen presentations. The WebContents must belong to |
| + // an incognito profile. |
| + if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl:: |
| + FromWebContents(web_contents)) { |
| + DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord()); |
|
mark a. foltz
2017/01/10 23:05:34
If you're converting this back to a DCHECK, then p
zhaobin
2017/01/11 03:13:37
Done.
|
| + return impl; |
| + } |
| + } |
| +#endif // defined(ENABLE_MEDIA_ROUTER) |
| + return nullptr; |
| +} |
| + |
| void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
| const GURL& url) { |
| if (url.is_valid()) { |