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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: Created 4 years, 1 month 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bf57e9244712c128072a09372f3a65a50466bdbc..f6d8bc6ea430fb3de1d86f1dda8666a4b53b470b 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)
@@ -3054,9 +3055,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::
@@ -3066,6 +3067,22 @@ ChromeContentBrowserClient::GetPresentationServiceDelegate(
return nullptr;
}
+content::ReceiverPresentationServiceDelegate*
+ChromeContentBrowserClient::GetReceiverPresentationServiceDelegate(
+ content::WebContents* web_contents) {
+ if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
mark a. foltz 2016/11/08 23:40:51 Please guard code that uses media_router:: with #i
zhaobin 2016/11/10 04:13:59 Done.
+ // 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 2016/11/08 23:40:51 API design opinion: This API is part of content/b
zhaobin 2016/11/10 04:13:59 Done.
+ return impl;
+ }
+ }
+ return nullptr;
+}
+
void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
const GURL& url) {
if (url.is_valid()) {

Powered by Google App Engine
This is Rietveld 408576698