OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DeviceLightEvent_h | 5 #ifndef DeviceLightEvent_h |
6 #define DeviceLightEvent_h | 6 #define DeviceLightEvent_h |
7 | 7 |
8 #include "modules/EventModules.h" | 8 #include "modules/EventModules.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 struct DeviceLightEventInit : public EventInit { | 13 struct DeviceLightEventInit : public EventInit { |
14 DeviceLightEventInit() | 14 DeviceLightEventInit() |
15 : value(std::numeric_limits<double>::infinity()) | 15 : value(std::numeric_limits<double>::infinity()) |
16 { | 16 { |
17 bubbles = true; | 17 bubbles = true; |
18 }; | 18 }; |
19 | 19 |
20 double value; | 20 double value; |
21 }; | 21 }; |
22 | 22 |
23 class DeviceLightEvent FINAL : public Event { | 23 class DeviceLightEvent final : public Event { |
24 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
25 public: | 25 public: |
26 virtual ~DeviceLightEvent(); | 26 virtual ~DeviceLightEvent(); |
27 | 27 |
28 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create() | 28 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create() |
29 { | 29 { |
30 return adoptRefWillBeNoop(new DeviceLightEvent); | 30 return adoptRefWillBeNoop(new DeviceLightEvent); |
31 } | 31 } |
32 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e
ventType, double value) | 32 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e
ventType, double value) |
33 { | 33 { |
34 return adoptRefWillBeNoop(new DeviceLightEvent(eventType, value)); | 34 return adoptRefWillBeNoop(new DeviceLightEvent(eventType, value)); |
35 } | 35 } |
36 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e
ventType, const DeviceLightEventInit& initializer) | 36 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e
ventType, const DeviceLightEventInit& initializer) |
37 { | 37 { |
38 return adoptRefWillBeNoop(new DeviceLightEvent(eventType, initializer)); | 38 return adoptRefWillBeNoop(new DeviceLightEvent(eventType, initializer)); |
39 } | 39 } |
40 | 40 |
41 double value() const { return m_value; } | 41 double value() const { return m_value; } |
42 | 42 |
43 virtual const AtomicString& interfaceName() const OVERRIDE; | 43 virtual const AtomicString& interfaceName() const override; |
44 | 44 |
45 private: | 45 private: |
46 DeviceLightEvent(); | 46 DeviceLightEvent(); |
47 DeviceLightEvent(const AtomicString& eventType, double value); | 47 DeviceLightEvent(const AtomicString& eventType, double value); |
48 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit&
initializer); | 48 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit&
initializer); |
49 | 49 |
50 double m_value; | 50 double m_value; |
51 }; | 51 }; |
52 | 52 |
53 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == Even
tNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent)
; | 53 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == Even
tNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent)
; |
54 | 54 |
55 } // namespace blink | 55 } // namespace blink |
56 | 56 |
57 #endif // DeviceLightEvent_h | 57 #endif // DeviceLightEvent_h |
OLD | NEW |