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 cd227d1fe2b0e63680d41cccaf5dfa1bbb4f19ee..3737255325f10644b87f375634c08d61fd104018 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -331,6 +331,7 @@ |
#include "chrome/browser/media/cast_remoting_connector.h" |
#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 |
#if defined(ENABLE_WAYLAND_SERVER) |
@@ -3050,9 +3051,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:: |
@@ -3062,6 +3063,22 @@ ChromeContentBrowserClient::GetPresentationServiceDelegate( |
return nullptr; |
} |
+content::ReceiverPresentationServiceDelegate* |
+ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate( |
+ content::WebContents* web_contents) { |
+ 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()); |
+ return impl; |
+ } |
+ } |
+ return nullptr; |
+} |
+ |
void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
const GURL& url) { |
if (url.is_valid()) { |