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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2498203004: Move media::mojom::RemoterFactory to content, add ContentBrowserClient API. (Closed)
Patch Set: REBASE 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/media/cast_remoting_connector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ef1c06a0ba230b4ad04689740b8c3fbf3e43195e..8ea2e77ff235ba876d464c0ed23e461dca49a130 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -333,11 +333,15 @@
#endif
#if defined(ENABLE_MEDIA_ROUTER)
-#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"
+#endif // defined(ENABLE_MEDIA_ROUTER)
+
+#if BUILDFLAG(ENABLE_MEDIA_REMOTING) && defined(ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/cast_remoting_connector.h"
#endif
+
#if defined(ENABLE_WAYLAND_SERVER)
#include "chrome/browser/chrome_browser_main_extra_parts_exo.h"
#endif
@@ -2980,12 +2984,6 @@ void ChromeContentBrowserClient::RegisterRenderFrameMojoInterfaces(
web_contents->GetJavaInterfaces()->GetWeakPtr()));
}
#endif
-
-#if defined(ENABLE_MEDIA_ROUTER)
- registry->AddInterface(
- base::Bind(&CastRemotingConnector::CreateRemoterFactory,
- render_frame_host));
-#endif
}
void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess(
@@ -3246,3 +3244,21 @@ std::unique_ptr<content::MemoryCoordinatorDelegate>
ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() {
return memory::ChromeMemoryCoordinatorDelegate::Create();
}
+
+#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
+void ChromeContentBrowserClient::CreateMediaRemoter(
+ content::RenderFrameHost* render_frame_host,
+ media::mojom::RemotingSourcePtr source,
+ media::mojom::RemoterRequest request) {
+#if defined(ENABLE_MEDIA_ROUTER)
+ CastRemotingConnector::CreateMediaRemoter(
+ render_frame_host, std::move(source), std::move(request));
+#else
+ // Chrome's media remoting implementation depends on the Media Router
+ // infrastructure to identify remote sinks and provide the user interface for
+ // sink selection. In the case where the Media Router is not present, simply
+ // drop the interface request. This will prevent code paths for media remoting
+ // in the renderer process from activating.
+#endif
+}
+#endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/media/cast_remoting_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698