| Index: content/renderer/vr_dispatcher.cc
|
| diff --git a/content/renderer/vr_dispatcher.cc b/content/renderer/vr_dispatcher.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..07025202b9ef9341a8d79cdfc4d867332c8b1aaa
|
| --- /dev/null
|
| +++ b/content/renderer/vr_dispatcher.cc
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/renderer/vr_dispatcher.h"
|
| +
|
| +#include "content/public/renderer/render_thread.h"
|
| +#include "ipc/ipc_sync_message_filter.h"
|
| +
|
| +namespace content {
|
| +
|
| +VRDispatcher::VRDispatcher() {
|
| +}
|
| +
|
| +VRDispatcher::~VRDispatcher() {
|
| +}
|
| +
|
| +void VRDispatcher::GetVRDevices(
|
| + blink::WebVector<blink::WebVRDevice>* devices) {
|
| + std::vector<blink::WebVRDevice> ipcDevices;
|
| +
|
| + RenderThread::Get()->Send(new VRHostMsg_GetVRDevices(&ipcDevices));
|
| + if (devices && ipcDevices.size() > 0)
|
| + devices->assign(&ipcDevices.front(), ipcDevices.size());
|
| +}
|
| +
|
| +void VRDispatcher::GetHMDSensorState(
|
| + unsigned int index, blink::WebHMDSensorState& state) {
|
| + RenderThread::Get()->Send(new VRHostMsg_GetHMDSensorState(index, &state));
|
| +}
|
| +
|
| +void VRDispatcher::ResetSensor(unsigned int index) {
|
| + RenderThread::Get()->Send(new VRHostMsg_ResetSensor(index));
|
| +}
|
| +
|
| +void VRDispatcher::GetRenderTargetRects(unsigned index,
|
| + blink::WebVRFieldOfView leftFov,
|
| + blink::WebVRFieldOfView rightFov,
|
| + blink::WebVRVector4* leftRect,
|
| + blink::WebVRVector4* rightRect) {
|
| + RenderThread::Get()->Send(new VRHostMsg_GetRenderTargetRects(
|
| + index, leftFov, rightFov, leftRect, rightRect));
|
| +}
|
| +
|
| +} // namespace content
|
|
|