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 DeviceAccelerationInit; | 37 class DeviceAccelerationInit; |
34 class DeviceMotionEventInit; | 38 class DeviceMotionEventInit; |
35 class DeviceRotationRateInit; | 39 class DeviceRotationRateInit; |
36 class WebDeviceMotionData; | |
37 | 40 |
38 class DeviceMotionData final : public GarbageCollected<DeviceMotionData> { | 41 class DeviceMotionData final : public GarbageCollected<DeviceMotionData> { |
39 public: | 42 public: |
40 class Acceleration final | 43 class Acceleration final |
41 : public GarbageCollected<DeviceMotionData::Acceleration> { | 44 : public GarbageCollected<DeviceMotionData::Acceleration> { |
42 public: | 45 public: |
43 static Acceleration* create(bool canProvideX, | 46 static Acceleration* create(bool canProvideX, |
44 double x, | 47 double x, |
45 bool canProvideY, | 48 bool canProvideY, |
46 double y, | 49 double y, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 bool m_canProvideGamma; | 114 bool m_canProvideGamma; |
112 }; | 115 }; |
113 | 116 |
114 static DeviceMotionData* create(); | 117 static DeviceMotionData* create(); |
115 static DeviceMotionData* create(Acceleration*, | 118 static DeviceMotionData* create(Acceleration*, |
116 Acceleration* accelerationIncludingGravity, | 119 Acceleration* accelerationIncludingGravity, |
117 RotationRate*, | 120 RotationRate*, |
118 bool canProvideInterval, | 121 bool canProvideInterval, |
119 double interval); | 122 double interval); |
120 static DeviceMotionData* create(const DeviceMotionEventInit&); | 123 static DeviceMotionData* create(const DeviceMotionEventInit&); |
121 static DeviceMotionData* create(const WebDeviceMotionData&); | 124 static DeviceMotionData* create(const device::MotionData&); |
122 DECLARE_TRACE(); | 125 DECLARE_TRACE(); |
123 | 126 |
124 Acceleration* getAcceleration() const { return m_acceleration.get(); } | 127 Acceleration* getAcceleration() const { return m_acceleration.get(); } |
125 Acceleration* getAccelerationIncludingGravity() const { | 128 Acceleration* getAccelerationIncludingGravity() const { |
126 return m_accelerationIncludingGravity.get(); | 129 return m_accelerationIncludingGravity.get(); |
127 } | 130 } |
128 RotationRate* getRotationRate() const { return m_rotationRate.get(); } | 131 RotationRate* getRotationRate() const { return m_rotationRate.get(); } |
129 | 132 |
130 bool canProvideInterval() const { return m_canProvideInterval; } | 133 bool canProvideInterval() const { return m_canProvideInterval; } |
131 double interval() const { return m_interval; } | 134 double interval() const { return m_interval; } |
(...skipping 11 matching lines...) Expand all Loading... |
143 Member<Acceleration> m_acceleration; | 146 Member<Acceleration> m_acceleration; |
144 Member<Acceleration> m_accelerationIncludingGravity; | 147 Member<Acceleration> m_accelerationIncludingGravity; |
145 Member<RotationRate> m_rotationRate; | 148 Member<RotationRate> m_rotationRate; |
146 bool m_canProvideInterval; | 149 bool m_canProvideInterval; |
147 double m_interval; | 150 double m_interval; |
148 }; | 151 }; |
149 | 152 |
150 } // namespace blink | 153 } // namespace blink |
151 | 154 |
152 #endif // DeviceMotionData_h | 155 #endif // DeviceMotionData_h |
OLD | NEW |