Index: content/browser/frame_host/render_frame_host_impl.cc |
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
index fadeeca42041cb03120150ffe39978fa7c35804d..170858d63e209d75009c60f6e23e57b59e23da76 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.cc |
+++ b/content/browser/frame_host/render_frame_host_impl.cc |
@@ -80,6 +80,7 @@ |
#include "content/public/common/isolated_world_ids.h" |
#include "content/public/common/url_constants.h" |
#include "content/public/common/url_utils.h" |
+#include "device/sensors/sensor_service.h" |
#include "device/vibration/vibration_manager_impl.h" |
#include "services/shell/public/cpp/interface_provider.h" |
#include "ui/accessibility/ax_tree.h" |
@@ -2072,6 +2073,13 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() { |
base::Bind(&device::VRDeviceManager::BindRequest)); |
} |
#endif |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableGenericSensors)) { |
+ GetInterfaceRegistry()->AddInterface(base::Bind( |
+ &device::SensorService::BindRequest, |
+ base::RetainedRef( |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); |
+ } |
GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( |
GetInterfaceRegistry(), this); |