| OLD | NEW |
| (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 #ifndef VRDevice_h | |
| 6 #define VRDevice_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | |
| 9 #include "modules/vr/VRHardwareUnit.h" | |
| 10 #include "platform/heap/Handle.h" | |
| 11 #include "wtf/Forward.h" | |
| 12 #include "wtf/text/WTFString.h" | |
| 13 | |
| 14 namespace blink { | |
| 15 | |
| 16 class VRController; | |
| 17 | |
| 18 class VRDevice : public GarbageCollectedFinalized<VRDevice>, public ScriptWrappa
ble { | |
| 19 DEFINE_WRAPPERTYPEINFO(); | |
| 20 public: | |
| 21 virtual ~VRDevice(); | |
| 22 | |
| 23 unsigned index() const { return m_hardwareUnit->index(); } | |
| 24 const String& hardwareUnitId() const { return m_hardwareUnit->hardwareUnitId
(); } | |
| 25 const String& deviceId() const { return m_deviceId; } | |
| 26 const String& deviceName() const { return m_deviceName; } | |
| 27 | |
| 28 VRHardwareUnit* hardwareUnit() { return m_hardwareUnit; } | |
| 29 const VRHardwareUnit* hardwareUnit() const { return m_hardwareUnit; } | |
| 30 | |
| 31 VRController* controller() { return m_hardwareUnit->controller(); } | |
| 32 | |
| 33 virtual void updateFromWebVRDevice(const WebVRDevice&); | |
| 34 | |
| 35 DECLARE_VIRTUAL_TRACE(); | |
| 36 | |
| 37 protected: | |
| 38 VRDevice(VRHardwareUnit*, unsigned); | |
| 39 | |
| 40 private: | |
| 41 Member<VRHardwareUnit> m_hardwareUnit; | |
| 42 String m_deviceId; | |
| 43 String m_deviceName; | |
| 44 }; | |
| 45 | |
| 46 using VRDeviceVector = HeapVector<Member<VRDevice>>; | |
| 47 | |
| 48 } // namespace blink | |
| 49 | |
| 50 #endif // VRDevice_h | |
| OLD | NEW |