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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: resolve code review comments from jam Created 4 years 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 bfb73d1f35ab718d9f2fbf1f7285c0b5bd2f05ca..63888177024817539a548c410413ba731d5e5ec2 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -344,6 +344,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)
@@ -3133,9 +3134,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::
@@ -3145,6 +3146,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.
+ auto* impl =
+ media_router::ReceiverPresentationServiceDelegateImpl::FromWebContents(
+ web_contents);
+ if (impl && web_contents->GetBrowserContext()->IsOffTheRecord())
dcheng 2017/01/06 11:54:22 I would expect the IsOffTheRecord() bit to a be a
zhaobin 2017/01/10 01:39:17 Mark suggests not using DCHECK in patch set 1: ma
dcheng 2017/01/10 06:46:58 It's not really that weird, IMO. If we shouldn't h
zhaobin 2017/01/10 21:49:54 Done.
+ return impl;
+ }
+#endif // defined(ENABLE_MEDIA_ROUTER)
+ 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