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

Side by Side Diff: content/renderer/vr_dispatcher.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the rest of sievers@ input Created 5 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/renderer/vr_dispatcher.h"
6
7 #include "content/public/renderer/render_thread.h"
8 #include "ipc/ipc_sync_message_filter.h"
9
10 namespace content {
11
12 VRDispatcher::VRDispatcher() {
13 }
14
15 VRDispatcher::~VRDispatcher() {
16 }
17
18 void VRDispatcher::GetVRDevices(
19 blink::WebVector<blink::WebVRDevice>* devices) {
20 std::vector<blink::WebVRDevice> ipcDevices;
21
22 RenderThread::Get()->Send(new VRHostMsg_GetVRDevices(&ipcDevices));
23 if (devices && ipcDevices.size() > 0)
24 devices->assign(&ipcDevices.front(), ipcDevices.size());
25 }
26
27 void VRDispatcher::GetSensorState(
28 unsigned int index, blink::WebHMDSensorState& state) {
29 RenderThread::Get()->Send(new VRHostMsg_GetSensorState(
30 index, &state));
31 }
32
33 void VRDispatcher::ResetSensor(unsigned int index) {
34 RenderThread::Get()->Send(new VRHostMsg_ResetSensor(index));
35 }
36
37 void VRDispatcher::GetRenderTargetRects(unsigned index,
38 blink::WebVRFieldOfView leftFov,
39 blink::WebVRFieldOfView rightFov,
40 blink::WebVRVector4* leftRect,
41 blink::WebVRVector4* rightRect) {
42 RenderThread::Get()->Send(new VRHostMsg_GetRenderTargetRects(
43 index, leftFov, rightFov, leftRect, rightRect));
44 }
45
46 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698