| 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 initEvent(type, bubbles, cancelable); | 54 initEvent(type, bubbles, cancelable); |
| 55 m_deviceMotionData = deviceMotionData; | 55 m_deviceMotionData = deviceMotionData; |
| 56 | 56 |
| 57 m_acceleration.clear(); | 57 m_acceleration.clear(); |
| 58 m_accelerationIncludingGravity.clear(); | 58 m_accelerationIncludingGravity.clear(); |
| 59 m_rotationRate.clear(); | 59 m_rotationRate.clear(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 DeviceAcceleration* DeviceMotionEvent::acceleration() | 62 DeviceAcceleration* DeviceMotionEvent::acceleration() |
| 63 { | 63 { |
| 64 if (!m_deviceMotionData->acceleration()) | 64 if (!m_deviceMotionData->getAcceleration()) |
| 65 return nullptr; | 65 return nullptr; |
| 66 | 66 |
| 67 if (!m_acceleration) | 67 if (!m_acceleration) |
| 68 m_acceleration = DeviceAcceleration::create(m_deviceMotionData->accelera
tion()); | 68 m_acceleration = DeviceAcceleration::create(m_deviceMotionData->getAccel
eration()); |
| 69 | 69 |
| 70 return m_acceleration.get(); | 70 return m_acceleration.get(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 DeviceAcceleration* DeviceMotionEvent::accelerationIncludingGravity() | 73 DeviceAcceleration* DeviceMotionEvent::accelerationIncludingGravity() |
| 74 { | 74 { |
| 75 if (!m_deviceMotionData->accelerationIncludingGravity()) | 75 if (!m_deviceMotionData->getAccelerationIncludingGravity()) |
| 76 return nullptr; | 76 return nullptr; |
| 77 | 77 |
| 78 if (!m_accelerationIncludingGravity) | 78 if (!m_accelerationIncludingGravity) |
| 79 m_accelerationIncludingGravity = DeviceAcceleration::create(m_deviceMoti
onData->accelerationIncludingGravity()); | 79 m_accelerationIncludingGravity = DeviceAcceleration::create(m_deviceMoti
onData->getAccelerationIncludingGravity()); |
| 80 | 80 |
| 81 return m_accelerationIncludingGravity.get(); | 81 return m_accelerationIncludingGravity.get(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 DeviceRotationRate* DeviceMotionEvent::rotationRate() | 84 DeviceRotationRate* DeviceMotionEvent::rotationRate() |
| 85 { | 85 { |
| 86 if (!m_deviceMotionData->rotationRate()) | 86 if (!m_deviceMotionData->getRotationRate()) |
| 87 return nullptr; | 87 return nullptr; |
| 88 | 88 |
| 89 if (!m_rotationRate) | 89 if (!m_rotationRate) |
| 90 m_rotationRate = DeviceRotationRate::create(m_deviceMotionData->rotation
Rate()); | 90 m_rotationRate = DeviceRotationRate::create(m_deviceMotionData->getRotat
ionRate()); |
| 91 | 91 |
| 92 return m_rotationRate.get(); | 92 return m_rotationRate.get(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 double DeviceMotionEvent::interval(bool& isNull) const | 95 double DeviceMotionEvent::interval(bool& isNull) const |
| 96 { | 96 { |
| 97 if (m_deviceMotionData->canProvideInterval()) | 97 if (m_deviceMotionData->canProvideInterval()) |
| 98 return m_deviceMotionData->interval(); | 98 return m_deviceMotionData->interval(); |
| 99 | 99 |
| 100 isNull = true; | 100 isNull = true; |
| 101 return 0; | 101 return 0; |
| 102 } | 102 } |
| 103 | 103 |
| 104 const AtomicString& DeviceMotionEvent::interfaceName() const | 104 const AtomicString& DeviceMotionEvent::interfaceName() const |
| 105 { | 105 { |
| 106 return EventNames::DeviceMotionEvent; | 106 return EventNames::DeviceMotionEvent; |
| 107 } | 107 } |
| 108 | 108 |
| 109 DEFINE_TRACE(DeviceMotionEvent) | 109 DEFINE_TRACE(DeviceMotionEvent) |
| 110 { | 110 { |
| 111 visitor->trace(m_deviceMotionData); | 111 visitor->trace(m_deviceMotionData); |
| 112 visitor->trace(m_acceleration); | 112 visitor->trace(m_acceleration); |
| 113 visitor->trace(m_accelerationIncludingGravity); | 113 visitor->trace(m_accelerationIncludingGravity); |
| 114 visitor->trace(m_rotationRate); | 114 visitor->trace(m_rotationRate); |
| 115 Event::trace(visitor); | 115 Event::trace(visitor); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |