| Index: Source/modules/devicelight/DeviceLightEvent.h
|
| diff --git a/Source/modules/device_orientation/DeviceOrientationEvent.h b/Source/modules/devicelight/DeviceLightEvent.h
|
| similarity index 52%
|
| copy from Source/modules/device_orientation/DeviceOrientationEvent.h
|
| copy to Source/modules/devicelight/DeviceLightEvent.h
|
| index 243f5c220039e322c1fb41cfb94bc043028e0b2f..a3b68d7c0eb15600d719bf7c8fbdb18669388211 100644
|
| --- a/Source/modules/device_orientation/DeviceOrientationEvent.h
|
| +++ b/Source/modules/devicelight/DeviceLightEvent.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright 2010, The Android Open Source Project
|
| + * Copyright (C) 2014 Intel Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions
|
| @@ -23,50 +23,56 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef DeviceOrientationEvent_h
|
| -#define DeviceOrientationEvent_h
|
| +#ifndef DeviceLightEvent_h
|
| +#define DeviceLightEvent_h
|
|
|
| #include "core/events/Event.h"
|
| #include "heap/Handle.h"
|
|
|
| namespace WebCore {
|
|
|
| -class DeviceOrientationData;
|
| +struct DeviceLightEventInit : public EventInit {
|
| + DeviceLightEventInit()
|
| + : value(std::numeric_limits<double>::infinity())
|
| + {
|
| + bubbles = true;
|
| + };
|
| +
|
| + double value;
|
| +};
|
|
|
| -class DeviceOrientationEvent FINAL : public Event {
|
| +class DeviceLightEvent FINAL : public Event {
|
| public:
|
| - virtual ~DeviceOrientationEvent();
|
| - static PassRefPtr<DeviceOrientationEvent> create()
|
| + virtual ~DeviceLightEvent();
|
| +
|
| + static PassRefPtrWillBeRawPtr<DeviceLightEvent> create()
|
| {
|
| - return adoptRef(new DeviceOrientationEvent);
|
| + return adoptRefWillBeRefCountedGarbageCollected(new DeviceLightEvent);
|
| }
|
| - static PassRefPtr<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation)
|
| + static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, const double value)
|
| {
|
| - return adoptRef(new DeviceOrientationEvent(eventType, orientation));
|
| + return adoptRefWillBeRefCountedGarbageCollected(new DeviceLightEvent(eventType, value));
|
| + }
|
| + static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, const DeviceLightEventInit& initializer)
|
| + {
|
| + return adoptRefWillBeRefCountedGarbageCollected(new DeviceLightEvent(eventType, initializer));
|
| }
|
|
|
| - void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientationData*);
|
| -
|
| - DeviceOrientationData* orientation() const { return m_orientation.get(); }
|
| -
|
| - double alpha(bool& isNull) const;
|
| - double beta(bool& isNull) const;
|
| - double gamma(bool& isNull) const;
|
| - bool absolute(bool& isNull) const;
|
| + double value() const { return m_value; }
|
|
|
| virtual const AtomicString& interfaceName() const OVERRIDE;
|
| -
|
| virtual void trace(Visitor*) OVERRIDE;
|
|
|
| private:
|
| - DeviceOrientationEvent();
|
| - DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientationData*);
|
| + DeviceLightEvent();
|
| + DeviceLightEvent(const AtomicString& eventType, const double value);
|
| + DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer);
|
|
|
| - RefPtrWillBeMember<DeviceOrientationData> m_orientation;
|
| + double m_value;
|
| };
|
|
|
| -DEFINE_TYPE_CASTS(DeviceOrientationEvent, Event, event, event->interfaceName() == EventNames::DeviceOrientationEvent, event.interfaceName() == EventNames::DeviceOrientationEvent);
|
| +DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == EventNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent);
|
|
|
| } // namespace WebCore
|
|
|
| -#endif // DeviceOrientationEvent_h
|
| +#endif // DeviceLightEvent_h
|
|
|