| 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 23b85095b8c6428f195775fae766ca2aa56ea70d..17c47514c887f8c303ce7ae1c8e59f2d9cd21c0e 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -323,6 +323,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
|
|
|
| #if defined(ENABLE_WAYLAND_SERVER)
|
| @@ -3009,6 +3010,13 @@ ChromeContentBrowserClient::GetPresentationServiceDelegate(
|
| content::WebContents* web_contents) {
|
| #if defined(ENABLE_MEDIA_ROUTER)
|
| if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
|
| + // ReceiverPresentationServiceDelegateImpl are for WebContents created for
|
| + // offscreen presentations. The WebContents is from an incognito profile.
|
| + if (auto* impl = media_router::ReceiverPresentationServiceDelegateImpl::
|
| + FromWebContents(web_contents)) {
|
| + DCHECK(web_contents->GetBrowserContext()->IsOffTheRecord());
|
| + return impl;
|
| + }
|
| return media_router::PresentationServiceDelegateImpl::
|
| GetOrCreateForWebContents(web_contents);
|
| }
|
|
|