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

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: Refactored singleton lifetime 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/common/vr_messages.h"
8 #include "content/public/renderer/render_thread.h"
9 #include "ipc/ipc_sync_message_filter.h"
10
11 namespace content {
12
13 VRDispatcher::VRDispatcher() {
14 }
15
16 VRDispatcher::~VRDispatcher() {
17 }
18
19 void VRDispatcher::GetVRDevices(
20 blink::WebVector<blink::WebVRDevice>* devices) {
21 std::vector<blink::WebVRDevice> ipcDevices;
22
23 RenderThread::Get()->Send(new VRHostMsg_GetVRDevices(&ipcDevices));
24 if (devices && ipcDevices.size() > 0)
25 devices->assign(&ipcDevices.front(), ipcDevices.size());
26 }
27
28 void VRDispatcher::GetSensorState(
29 unsigned int index, blink::WebHMDSensorState& state) {
30 RenderThread::Get()->Send(new VRHostMsg_GetSensorState(
31 index, &state));
32 }
33
34 void VRDispatcher::ResetSensor(unsigned int index) {
35 RenderThread::Get()->Send(new VRHostMsg_ResetSensor(index));
36 }
37
38 void VRDispatcher::GetRenderTargetRects(unsigned index,
39 blink::WebVRFieldOfView leftFov,
40 blink::WebVRFieldOfView rightFov,
41 blink::WebVRVector4* leftRect,
42 blink::WebVRVector4* rightRect) {
43 RenderThread::Get()->Send(new VRHostMsg_GetRenderTargetRects(
44 index, leftFov, rightFov, leftRect, rightRect));
45 }
46
47 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698