| 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 #ifndef CONTENT_RENDERER_VR_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_VR_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_VR_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_VR_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // blink::WebVRClient implementation. | 26 // blink::WebVRClient implementation. |
| 27 void getDevices(blink::WebVRGetDevicesCallback* callback) override; | 27 void getDevices(blink::WebVRGetDevicesCallback* callback) override; |
| 28 | 28 |
| 29 void getSensorState(unsigned int index, | 29 void getSensorState(unsigned int index, |
| 30 blink::WebHMDSensorState& state) override; | 30 blink::WebHMDSensorState& state) override; |
| 31 | 31 |
| 32 void resetSensor(unsigned int index) override; | 32 void resetSensor(unsigned int index) override; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // Helper method that returns an initialized PermissionServicePtr. | 35 // Helper method that returns an initialized PermissionServicePtr. |
| 36 VRServicePtr& GetVRServicePtr(); | 36 mojom::VRServicePtr& GetVRServicePtr(); |
| 37 | 37 |
| 38 // Callback handlers | 38 // Callback handlers |
| 39 void OnGetDevices(int request_id, | 39 void OnGetDevices(int request_id, |
| 40 const mojo::Array<VRDeviceInfoPtr>& devices); | 40 const mojo::Array<mojom::VRDeviceInfoPtr>& devices); |
| 41 static void OnGetSensorState(blink::WebHMDSensorState* state, | 41 static void OnGetSensorState(blink::WebHMDSensorState* state, |
| 42 const VRSensorStatePtr& mojo_state); | 42 const mojom::VRSensorStatePtr& mojo_state); |
| 43 | 43 |
| 44 // Tracks requests sent to browser to match replies with callbacks. | 44 // Tracks requests sent to browser to match replies with callbacks. |
| 45 // Owns callback objects. | 45 // Owns callback objects. |
| 46 IDMap<blink::WebVRGetDevicesCallback, IDMapOwnPointer> pending_requests_; | 46 IDMap<blink::WebVRGetDevicesCallback, IDMapOwnPointer> pending_requests_; |
| 47 | 47 |
| 48 ServiceRegistry* service_registry_; | 48 ServiceRegistry* service_registry_; |
| 49 VRServicePtr vr_service_; | 49 mojom::VRServicePtr vr_service_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(VRDispatcher); | 51 DISALLOW_COPY_AND_ASSIGN(VRDispatcher); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace content | 54 } // namespace content |
| 55 | 55 |
| 56 #endif // CONTENT_RENDERER_VR_DISPATCHER_H_ | 56 #endif // CONTENT_RENDERER_VR_DISPATCHER_H_ |
| OLD | NEW |