| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010, The Android Open Source Project | 2 * Copyright 2010, The Android Open Source Project |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type
, bool bubbles, bool cancelable, const Nullable<double>& alpha, const Nullable<d
ouble>& beta, const Nullable<double>& gamma, const Nullable<bool>& absolute) | 48 void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type
, bool bubbles, bool cancelable, const Nullable<double>& alpha, const Nullable<d
ouble>& beta, const Nullable<double>& gamma, const Nullable<bool>& absolute) |
| 49 { | 49 { |
| 50 if (dispatched()) | 50 if (dispatched()) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 initEvent(type, bubbles, cancelable); | 53 initEvent(type, bubbles, cancelable); |
| 54 m_orientation = DeviceOrientationData::create(alpha, beta, gamma, absolute); | 54 m_orientation = DeviceOrientationData::create(alpha, beta, gamma, absolute); |
| 55 } | 55 } |
| 56 | 56 |
| 57 DeviceOrientationData* DeviceOrientationEvent::orientation() const | |
| 58 { | |
| 59 return m_orientation.get(); | |
| 60 } | |
| 61 | |
| 62 double DeviceOrientationEvent::alpha(bool& isNull) const | 57 double DeviceOrientationEvent::alpha(bool& isNull) const |
| 63 { | 58 { |
| 64 if (m_orientation->canProvideAlpha()) | 59 if (m_orientation->canProvideAlpha()) |
| 65 return m_orientation->alpha(); | 60 return m_orientation->alpha(); |
| 66 | 61 |
| 67 isNull = true; | 62 isNull = true; |
| 68 return 0; | 63 return 0; |
| 69 } | 64 } |
| 70 | 65 |
| 71 double DeviceOrientationEvent::beta(bool& isNull) const | 66 double DeviceOrientationEvent::beta(bool& isNull) const |
| (...skipping 28 matching lines...) Expand all Loading... |
| 100 return EventNames::DeviceOrientationEvent; | 95 return EventNames::DeviceOrientationEvent; |
| 101 } | 96 } |
| 102 | 97 |
| 103 DEFINE_TRACE(DeviceOrientationEvent) | 98 DEFINE_TRACE(DeviceOrientationEvent) |
| 104 { | 99 { |
| 105 visitor->trace(m_orientation); | 100 visitor->trace(m_orientation); |
| 106 Event::trace(visitor); | 101 Event::trace(visitor); |
| 107 } | 102 } |
| 108 | 103 |
| 109 } // namespace blink | 104 } // namespace blink |
| OLD | NEW |