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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/SensorReadingEvent.h

Issue 1892083002: Generic Sensor API : Ambient Light Sensor API. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2016 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 SensorReadingEvent_h
6 #define SensorReadingEvent_h
7
8 #include "modules/EventModules.h"
9 #include "modules/sensor/SensorReading.h"
10 #include "modules/sensor/SensorReadingEventInit.h"
11 #include "platform/heap/Handle.h"
12
13 namespace blink {
14
15 class SensorReadingEvent : public Event {
16 DEFINE_WRAPPERTYPEINFO();
17
18 public:
19 static SensorReadingEvent* create()
20 {
21 return new SensorReadingEvent;
22 }
23
24 static SensorReadingEvent* create(const AtomicString& eventType)
25 {
26 return new SensorReadingEvent(eventType);
27 }
28
29 static SensorReadingEvent* create(const AtomicString& eventType, SensorReadi ng& reading)
30 {
31 return new SensorReadingEvent(eventType, reading);
32 }
33
34 static SensorReadingEvent* create(const AtomicString& eventType, const Senso rReadingEventInit& initializer)
35 {
36 return new SensorReadingEvent(eventType, initializer);
37 }
38
39 ~SensorReadingEvent() override;
40
41 DECLARE_VIRTUAL_TRACE();
42
43 SensorReading* reading() { return m_reading; }
44 const AtomicString& interfaceName() const override;
45
46 SensorReadingEvent();
47 SensorReadingEvent(const AtomicString& eventType);
48 SensorReadingEvent(const AtomicString& eventType, SensorReading&);
49 SensorReadingEvent(const AtomicString& eventType, const SensorReadingEventIn it& initializer);
50
51 protected:
52 Member<SensorReading> m_reading;
53 };
54
55 DEFINE_TYPE_CASTS(SensorReadingEvent, Event, event, event->interfaceName() == Ev entNames::SensorReadingEvent, event.interfaceName() == EventNames::SensorReading Event);
56
57 } // namepsace blink
58
59 #endif // SensorReadingEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698