| 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 14 matching lines...) Expand all Loading... |
| 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 blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class WebDeviceMotionData; | 33 class WebDeviceMotionData; |
| 34 | 34 |
| 35 class DeviceMotionData FINAL : public GarbageCollected<DeviceMotionData> { | 35 class DeviceMotionData final : public GarbageCollected<DeviceMotionData> { |
| 36 public: | 36 public: |
| 37 | 37 |
| 38 class Acceleration FINAL : public GarbageCollected<DeviceMotionData::Acceler
ation> { | 38 class Acceleration final : public GarbageCollected<DeviceMotionData::Acceler
ation> { |
| 39 public: | 39 public: |
| 40 static Acceleration* create(bool canProvideX, double x, bool canProvideY
, double y, bool canProvideZ, double z); | 40 static Acceleration* create(bool canProvideX, double x, bool canProvideY
, double y, bool canProvideZ, double z); |
| 41 void trace(Visitor*) { } | 41 void trace(Visitor*) { } |
| 42 | 42 |
| 43 bool canProvideX() const { return m_canProvideX; } | 43 bool canProvideX() const { return m_canProvideX; } |
| 44 bool canProvideY() const { return m_canProvideY; } | 44 bool canProvideY() const { return m_canProvideY; } |
| 45 bool canProvideZ() const { return m_canProvideZ; } | 45 bool canProvideZ() const { return m_canProvideZ; } |
| 46 | 46 |
| 47 double x() const { return m_x; } | 47 double x() const { return m_x; } |
| 48 double y() const { return m_y; } | 48 double y() const { return m_y; } |
| 49 double z() const { return m_z; } | 49 double z() const { return m_z; } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 Acceleration(bool canProvideX, double x, bool canProvideY, double y, boo
l canProvideZ, double z); | 52 Acceleration(bool canProvideX, double x, bool canProvideY, double y, boo
l canProvideZ, double z); |
| 53 | 53 |
| 54 double m_x; | 54 double m_x; |
| 55 double m_y; | 55 double m_y; |
| 56 double m_z; | 56 double m_z; |
| 57 | 57 |
| 58 bool m_canProvideX; | 58 bool m_canProvideX; |
| 59 bool m_canProvideY; | 59 bool m_canProvideY; |
| 60 bool m_canProvideZ; | 60 bool m_canProvideZ; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class RotationRate FINAL : public GarbageCollected<DeviceMotionData::Rotatio
nRate> { | 63 class RotationRate final : public GarbageCollected<DeviceMotionData::Rotatio
nRate> { |
| 64 public: | 64 public: |
| 65 static RotationRate* create(bool canProvideAlpha, double alpha, bool can
ProvideBeta, double beta, bool canProvideGamma, double gamma); | 65 static RotationRate* create(bool canProvideAlpha, double alpha, bool can
ProvideBeta, double beta, bool canProvideGamma, double gamma); |
| 66 void trace(Visitor*) { } | 66 void trace(Visitor*) { } |
| 67 | 67 |
| 68 bool canProvideAlpha() const { return m_canProvideAlpha; } | 68 bool canProvideAlpha() const { return m_canProvideAlpha; } |
| 69 bool canProvideBeta() const { return m_canProvideBeta; } | 69 bool canProvideBeta() const { return m_canProvideBeta; } |
| 70 bool canProvideGamma() const { return m_canProvideGamma; } | 70 bool canProvideGamma() const { return m_canProvideGamma; } |
| 71 | 71 |
| 72 double alpha() const { return m_alpha; } | 72 double alpha() const { return m_alpha; } |
| 73 double beta() const { return m_beta; } | 73 double beta() const { return m_beta; } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Member<Acceleration> m_acceleration; | 111 Member<Acceleration> m_acceleration; |
| 112 Member<Acceleration> m_accelerationIncludingGravity; | 112 Member<Acceleration> m_accelerationIncludingGravity; |
| 113 Member<RotationRate> m_rotationRate; | 113 Member<RotationRate> m_rotationRate; |
| 114 bool m_canProvideInterval; | 114 bool m_canProvideInterval; |
| 115 double m_interval; | 115 double m_interval; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| 119 | 119 |
| 120 #endif // DeviceMotionData_h | 120 #endif // DeviceMotionData_h |
| OLD | NEW |