Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: Source/modules/device_light/DeviceLightEvent.h

Issue 775763007: Use event init dictionary in modules/device_light (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/modules/device_light/DeviceLightEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "modules/device_light/DeviceLightEventInit.h"
9 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 struct DeviceLightEventInit : public EventInit {
14 DeviceLightEventInit()
15 : value(std::numeric_limits<double>::infinity())
16 {
17 bubbles = true;
18 };
19
20 double value;
21 };
22
23 class DeviceLightEvent final : public Event { 14 class DeviceLightEvent final : public Event {
24 DEFINE_WRAPPERTYPEINFO(); 15 DEFINE_WRAPPERTYPEINFO();
25 public: 16 public:
26 virtual ~DeviceLightEvent(); 17 virtual ~DeviceLightEvent();
27 18
28 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create() 19 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create()
29 { 20 {
30 return adoptRefWillBeNoop(new DeviceLightEvent); 21 return adoptRefWillBeNoop(new DeviceLightEvent);
31 } 22 }
32 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e ventType, double value) 23 static PassRefPtrWillBeRawPtr<DeviceLightEvent> create(const AtomicString& e ventType, double value)
(...skipping 15 matching lines...) Expand all
48 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer); 39 DeviceLightEvent(const AtomicString& eventType, const DeviceLightEventInit& initializer);
49 40
50 double m_value; 41 double m_value;
51 }; 42 };
52 43
53 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == Even tNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent) ; 44 DEFINE_TYPE_CASTS(DeviceLightEvent, Event, event, event->interfaceName() == Even tNames::DeviceLightEvent, event.interfaceName() == EventNames::DeviceLightEvent) ;
54 45
55 } // namespace blink 46 } // namespace blink
56 47
57 #endif // DeviceLightEvent_h 48 #endif // DeviceLightEvent_h
OLDNEW
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/modules/device_light/DeviceLightEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698