1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DeviceLightEvent_h
6 #define DeviceLightEvent_h
8 #include "modules/EventModules.h"
9 #include "platform/heap/Handle.h"
13 struct DeviceLightEventInit : public EventInit {
14 DeviceLightEventInit()
15 : value(std::numeric_limits<double>::infinity())
23 class DeviceLightEvent final : public Event {
24 DEFINE_WRAPPERTYPEINFO();
26 virtual ~DeviceLightEvent();
28 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create()
30 return adoptRefWillBeNoop(new DeviceLightEvent);
32 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, double value)
34 return adoptRefWillBeNoop(new DeviceLightEvent(eventType, value));
36 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& eventType, const DeviceLightEventInit& initializer)
38 return adoptRefWillBeNoop(new DeviceLightEvent(eventType, initializer));
41 double value() const { return m_value; }
43 virtual const AtomicString& interfaceName() const override;
47 DeviceLightEvent(const AtomicString& eventType, double value);
48 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer);
53 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == EventNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent);
57 #endif // DeviceLightEvent_h