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 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, De
viceOrientationData* orientation) | 41 DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, De
viceOrientationData* orientation) |
42 : Event(eventType, false, false) // Can't bubble, not cancelable | 42 : Event(eventType, false, false) // Can't bubble, not cancelable |
43 , m_orientation(orientation) | 43 , m_orientation(orientation) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type
, bool bubbles, bool cancelable, const Nullable<double>& alpha, const Nullable<d
ouble>& beta, const Nullable<double>& gamma, bool absolute) | 47 void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type
, bool bubbles, bool cancelable, const Nullable<double>& alpha, const Nullable<d
ouble>& beta, const Nullable<double>& gamma, bool absolute) |
48 { | 48 { |
49 if (dispatched()) | 49 if (isBeingDispatched()) |
50 return; | 50 return; |
51 | 51 |
52 initEvent(type, bubbles, cancelable); | 52 initEvent(type, bubbles, cancelable); |
53 m_orientation = DeviceOrientationData::create(alpha, beta, gamma, absolute); | 53 m_orientation = DeviceOrientationData::create(alpha, beta, gamma, absolute); |
54 } | 54 } |
55 | 55 |
56 double DeviceOrientationEvent::alpha(bool& isNull) const | 56 double DeviceOrientationEvent::alpha(bool& isNull) const |
57 { | 57 { |
58 if (m_orientation->canProvideAlpha()) | 58 if (m_orientation->canProvideAlpha()) |
59 return m_orientation->alpha(); | 59 return m_orientation->alpha(); |
(...skipping 30 matching lines...) Expand all Loading... |
90 return EventNames::DeviceOrientationEvent; | 90 return EventNames::DeviceOrientationEvent; |
91 } | 91 } |
92 | 92 |
93 DEFINE_TRACE(DeviceOrientationEvent) | 93 DEFINE_TRACE(DeviceOrientationEvent) |
94 { | 94 { |
95 visitor->trace(m_orientation); | 95 visitor->trace(m_orientation); |
96 Event::trace(visitor); | 96 Event::trace(visitor); |
97 } | 97 } |
98 | 98 |
99 } // namespace blink | 99 } // namespace blink |
OLD | NEW |