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

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

Issue 143823004: Implement DeviceLight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Event not Oilpan-ed yet. Add a test back Created 6 years, 9 months 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698