diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/device_orientation/device_orientation_event.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/device_orientation/device_orientation_event.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/chromium/third_party/blink/renderer/modules/device_orientation/device_orientation_event.cc b/chromium/third_party/blink/renderer/modules/device_orientation/device_orientation_event.cc index acdb49f7df7..85809bff6da 100644 --- a/chromium/third_party/blink/renderer/modules/device_orientation/device_orientation_event.cc +++ b/chromium/third_party/blink/renderer/modules/device_orientation/device_orientation_event.cc @@ -25,8 +25,8 @@ #include "third_party/blink/renderer/modules/device_orientation/device_orientation_event.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_device_orientation_event_init.h" #include "third_party/blink/renderer/modules/device_orientation/device_orientation_data.h" -#include "third_party/blink/renderer/modules/device_orientation/device_orientation_event_init.h" namespace blink { @@ -47,6 +47,24 @@ DeviceOrientationEvent::DeviceOrientationEvent( : Event(event_type, Bubbles::kNo, Cancelable::kNo), orientation_(orientation) {} +base::Optional<double> DeviceOrientationEvent::alpha() const { + if (orientation_->CanProvideAlpha()) + return orientation_->Alpha(); + return base::nullopt; +} + +base::Optional<double> DeviceOrientationEvent::beta() const { + if (orientation_->CanProvideBeta()) + return orientation_->Beta(); + return base::nullopt; +} + +base::Optional<double> DeviceOrientationEvent::gamma() const { + if (orientation_->CanProvideGamma()) + return orientation_->Gamma(); + return base::nullopt; +} + double DeviceOrientationEvent::alpha(bool& is_null) const { if (orientation_->CanProvideAlpha()) return orientation_->Alpha(); @@ -79,7 +97,7 @@ const AtomicString& DeviceOrientationEvent::InterfaceName() const { return event_interface_names::kDeviceOrientationEvent; } -void DeviceOrientationEvent::Trace(blink::Visitor* visitor) { +void DeviceOrientationEvent::Trace(Visitor* visitor) { visitor->Trace(orientation_); Event::Trace(visitor); } |