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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed rockot@'s feedback. Created 5 years, 6 months 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: 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 7fe74daf4470e4eb5fd4f762c087e3152d3e7b54..7c716632b28086645523b74861512a588cba8bf8 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 {
@@ -1573,6 +1577,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);
}

Powered by Google App Engine
This is Rietveld 408576698