summaryrefslogtreecommitdiffstats
path: root/extensions/browser/mojo
diff options
context:
space:
mode:
authormikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>2016-01-14 07:24:05 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-14 15:26:35 +0000
commit61a28e373720d8f205d9fc37c09580804a36b038 (patch)
treeb2272bdbd457a7b8aab8491764d2cebeb6e95f46 /extensions/browser/mojo
parentc2103fb08d07c310047e7c4923e9caaa0ef76e35 (diff)
downloadchromium_src-61a28e373720d8f205d9fc37c09580804a36b038.zip
chromium_src-61a28e373720d8f205d9fc37c09580804a36b038.tar.gz
chromium_src-61a28e373720d8f205d9fc37c09580804a36b038.tar.bz2
Add WiFi Display session class skeleton and mojo service
This patch introduces a WiFi Display session class skeleton and mojo service which provides network access for the render-hosted session. The introduced code is compiled only if a newly added 'enable_wifi_display' build option is set. Besides, some minor changes were applied to the DisplaySourceConnectionDelegate interface in order to better define its methods behavior. BUG=242107 Review URL: https://codereview.chromium.org/1540563002 Cr-Commit-Position: refs/heads/master@{#369415}
Diffstat (limited to 'extensions/browser/mojo')
-rw-r--r--extensions/browser/mojo/service_registration.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/extensions/browser/mojo/service_registration.cc b/extensions/browser/mojo/service_registration.cc
index c3884ac..c6367f0 100644
--- a/extensions/browser/mojo/service_registration.cc
+++ b/extensions/browser/mojo/service_registration.cc
@@ -21,6 +21,10 @@
#include "extensions/common/extension_api.h"
#include "extensions/common/switches.h"
+#if defined(ENABLE_WIFI_DISPLAY)
+#include "extensions/browser/api/display_source/wifi_display/wifi_display_session_service_impl.h"
+#endif
+
namespace extensions {
namespace {
@@ -54,6 +58,15 @@ void RegisterServicesForFrame(content::RenderFrameHost* render_frame_host,
service_registry->AddService(base::Bind(
KeepAliveImpl::Create,
render_frame_host->GetProcess()->GetBrowserContext(), extension));
+
+#if defined(ENABLE_WIFI_DISPLAY)
+ if (ExtensionHasPermission(extension, render_frame_host->GetProcess(),
+ "displaySource")) {
+ service_registry->AddService(
+ base::Bind(WiFiDisplaySessionServiceImpl::BindToRequest,
+ render_frame_host->GetProcess()->GetBrowserContext()));
+ }
+#endif
}
} // namespace extensions