OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef DeviceLightEvent_h |
| 6 #define DeviceLightEvent_h |
| 7 |
| 8 #include "core/events/Event.h" |
| 9 |
| 10 namespace WebCore { |
| 11 |
| 12 struct DeviceLightEventInit : public EventInit { |
| 13 DeviceLightEventInit() |
| 14 : value(std::numeric_limits<double>::infinity()) |
| 15 { |
| 16 bubbles = true; |
| 17 }; |
| 18 |
| 19 double value; |
| 20 }; |
| 21 |
| 22 class DeviceLightEvent FINAL : public Event { |
| 23 public: |
| 24 virtual ~DeviceLightEvent(); |
| 25 |
| 26 static PassRefPtr<DeviceLightEvent> create() |
| 27 { |
| 28 return adoptRef(new DeviceLightEvent); |
| 29 } |
| 30 static PassRefPtr<DeviceLightEvent> create(const AtomicString& eventType, co
nst double value) |
| 31 { |
| 32 return adoptRef(new DeviceLightEvent(eventType, value)); |
| 33 } |
| 34 static PassRefPtr<DeviceLightEvent> create(const AtomicString& eventType, co
nst DeviceLightEventInit& initializer) |
| 35 { |
| 36 return adoptRef(new DeviceLightEvent(eventType, initializer)); |
| 37 } |
| 38 |
| 39 double value() const { return m_value; } |
| 40 |
| 41 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 42 |
| 43 private: |
| 44 DeviceLightEvent(); |
| 45 DeviceLightEvent(const AtomicString& eventType, const double value); |
| 46 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit&
initializer); |
| 47 |
| 48 double m_value; |
| 49 }; |
| 50 |
| 51 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == Even
tNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent)
; |
| 52 |
| 53 } // namespace WebCore |
| 54 |
| 55 #endif // DeviceLightEvent_h |
OLD | NEW |