summaryrefslogtreecommitdiffstats
path: root/content/browser/frame_host/render_frame_host_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/frame_host/render_frame_host_impl.cc')
-rw-r--r--content/browser/frame_host/render_frame_host_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 74ac164..11ae65a 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -81,6 +81,10 @@
#include "media/mojo/services/mojo_renderer_service.h"
#endif
+#if defined(ENABLE_WEBVR)
+#include "content/browser/vr/vr_device_manager.h"
+#endif
+
using base::TimeDelta;
namespace content {
@@ -1579,6 +1583,16 @@ void RenderFrameHostImpl::RegisterMojoServices() {
GetServiceRegistry()->AddService<mojo::Shell>(base::Bind(
&FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get())));
+#if defined(ENABLE_WEBVR)
+ const base::CommandLine& browser_command_line =
+ *base::CommandLine::ForCurrentProcess();
+
+ if (browser_command_line.HasSwitch(switches::kEnableWebVR)) {
+ GetServiceRegistry()->AddService<VRService>(
+ base::Bind(&VRDeviceManager::BindRequest));
+ }
+#endif
+
GetContentClient()->browser()->OverrideRenderFrameMojoServices(
GetServiceRegistry(), this);
}