OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/vr/vr_dispatcher.h" | 5 #include "content/renderer/vr/vr_dispatcher.h" |
6 | 6 |
7 #include "content/public/common/service_registry.h" | 7 #include "content/public/common/service_registry.h" |
8 #include "content/renderer/vr/vr_type_converters.h" | 8 #include "content/renderer/vr/vr_type_converters.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 blink::WebVRGetDevicesCallback* callback = | 51 blink::WebVRGetDevicesCallback* callback = |
52 pending_requests_.Lookup(request_id); | 52 pending_requests_.Lookup(request_id); |
53 if (!callback) | 53 if (!callback) |
54 return; | 54 return; |
55 | 55 |
56 for (size_t i = 0; i < devices.size(); ++i) { | 56 for (size_t i = 0; i < devices.size(); ++i) { |
57 web_devices[i] = devices[i].To<blink::WebVRDevice>(); | 57 web_devices[i] = devices[i].To<blink::WebVRDevice>(); |
58 } | 58 } |
59 | 59 |
60 callback->onSuccess(&web_devices); | 60 callback->onSuccess(web_devices); |
61 pending_requests_.Remove(request_id); | 61 pending_requests_.Remove(request_id); |
62 } | 62 } |
63 | 63 |
64 void VRDispatcher::OnGetSensorState(blink::WebHMDSensorState* state, | 64 void VRDispatcher::OnGetSensorState(blink::WebHMDSensorState* state, |
65 const VRSensorStatePtr& mojo_state) { | 65 const VRSensorStatePtr& mojo_state) { |
66 *state = mojo_state.To<blink::WebHMDSensorState>(); | 66 *state = mojo_state.To<blink::WebHMDSensorState>(); |
67 } | 67 } |
68 | 68 |
69 } // namespace content | 69 } // namespace content |
OLD | NEW |