| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef DeviceMotionData_h | 26 #ifndef DeviceMotionData_h |
| 27 #define DeviceMotionData_h | 27 #define DeviceMotionData_h |
| 28 | 28 |
| 29 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
| 30 | 30 |
| 31 namespace device { |
| 32 class MotionData; |
| 33 } |
| 34 |
| 31 namespace blink { | 35 namespace blink { |
| 32 | 36 |
| 33 class WebDeviceMotionData; | |
| 34 | |
| 35 class DeviceMotionData final : public GarbageCollected<DeviceMotionData> { | 37 class DeviceMotionData final : public GarbageCollected<DeviceMotionData> { |
| 36 public: | 38 public: |
| 37 class Acceleration final | 39 class Acceleration final |
| 38 : public GarbageCollected<DeviceMotionData::Acceleration> { | 40 : public GarbageCollected<DeviceMotionData::Acceleration> { |
| 39 public: | 41 public: |
| 40 static Acceleration* create(bool canProvideX, | 42 static Acceleration* create(bool canProvideX, |
| 41 double x, | 43 double x, |
| 42 bool canProvideY, | 44 bool canProvideY, |
| 43 double y, | 45 double y, |
| 44 bool canProvideZ, | 46 bool canProvideZ, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool m_canProvideBeta; | 107 bool m_canProvideBeta; |
| 106 bool m_canProvideGamma; | 108 bool m_canProvideGamma; |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 static DeviceMotionData* create(); | 111 static DeviceMotionData* create(); |
| 110 static DeviceMotionData* create(Acceleration*, | 112 static DeviceMotionData* create(Acceleration*, |
| 111 Acceleration* accelerationIncludingGravity, | 113 Acceleration* accelerationIncludingGravity, |
| 112 RotationRate*, | 114 RotationRate*, |
| 113 bool canProvideInterval, | 115 bool canProvideInterval, |
| 114 double interval); | 116 double interval); |
| 115 static DeviceMotionData* create(const WebDeviceMotionData&); | 117 static DeviceMotionData* create(const device::MotionData&); |
| 116 DECLARE_TRACE(); | 118 DECLARE_TRACE(); |
| 117 | 119 |
| 118 Acceleration* getAcceleration() const { return m_acceleration.get(); } | 120 Acceleration* getAcceleration() const { return m_acceleration.get(); } |
| 119 Acceleration* getAccelerationIncludingGravity() const { | 121 Acceleration* getAccelerationIncludingGravity() const { |
| 120 return m_accelerationIncludingGravity.get(); | 122 return m_accelerationIncludingGravity.get(); |
| 121 } | 123 } |
| 122 RotationRate* getRotationRate() const { return m_rotationRate.get(); } | 124 RotationRate* getRotationRate() const { return m_rotationRate.get(); } |
| 123 | 125 |
| 124 bool canProvideInterval() const { return m_canProvideInterval; } | 126 bool canProvideInterval() const { return m_canProvideInterval; } |
| 125 double interval() const { return m_interval; } | 127 double interval() const { return m_interval; } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 137 Member<Acceleration> m_acceleration; | 139 Member<Acceleration> m_acceleration; |
| 138 Member<Acceleration> m_accelerationIncludingGravity; | 140 Member<Acceleration> m_accelerationIncludingGravity; |
| 139 Member<RotationRate> m_rotationRate; | 141 Member<RotationRate> m_rotationRate; |
| 140 bool m_canProvideInterval; | 142 bool m_canProvideInterval; |
| 141 double m_interval; | 143 double m_interval; |
| 142 }; | 144 }; |
| 143 | 145 |
| 144 } // namespace blink | 146 } // namespace blink |
| 145 | 147 |
| 146 #endif // DeviceMotionData_h | 148 #endif // DeviceMotionData_h |
| OLD | NEW |