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 |
57 double DeviceOrientationEvent::alpha(bool& isNull) const | 62 double DeviceOrientationEvent::alpha(bool& isNull) const |
58 { | 63 { |
59 if (m_orientation->canProvideAlpha()) | 64 if (m_orientation->canProvideAlpha()) |
60 return m_orientation->alpha(); | 65 return m_orientation->alpha(); |
61 | 66 |
62 isNull = true; | 67 isNull = true; |
63 return 0; | 68 return 0; |
64 } | 69 } |
65 | 70 |
66 double DeviceOrientationEvent::beta(bool& isNull) const | 71 double DeviceOrientationEvent::beta(bool& isNull) const |
(...skipping 28 matching lines...) Expand all Loading... |
95 return EventNames::DeviceOrientationEvent; | 100 return EventNames::DeviceOrientationEvent; |
96 } | 101 } |
97 | 102 |
98 DEFINE_TRACE(DeviceOrientationEvent) | 103 DEFINE_TRACE(DeviceOrientationEvent) |
99 { | 104 { |
100 visitor->trace(m_orientation); | 105 visitor->trace(m_orientation); |
101 Event::trace(visitor); | 106 Event::trace(visitor); |
102 } | 107 } |
103 | 108 |
104 } // namespace blink | 109 } // namespace blink |
OLD | NEW |