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

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

Issue 1892083002: Generic Sensor API : Ambient Light Sensor API. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: re entrancy fix Created 4 years, 6 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 AmbientLightSensor_h
6 #define AmbientLightSensor_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseProperty.h"
10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "core/dom/ActiveDOMObject.h"
12 #include "modules/EventTargetModules.h"
13 #include "modules/ModulesExport.h"
14 #include "modules/sensor/AmbientLightSensorReading.h"
15 #include "modules/sensor/Sensor.h"
16 #include "modules/sensor/SensorOptions.h"
17 #include "modules/sensor/SensorState.h"
18 #include "modules/sensor/als_reading.h"
19 #include "platform/heap/Handle.h"
20 #include "wtf/text/WTFString.h"
21
22 namespace blink {
23
24 class ExceptionState;
25 class ScriptState;
26
27 class AmbientLightSensor
28 : public Sensor {
29 USING_GARBAGE_COLLECTED_MIXIN(AmbientLightSensor);
30 DEFINE_WRAPPERTYPEINFO();
31
32 public:
33 static AmbientLightSensor* create(ExecutionContext*, SensorOptions, Exceptio nState&);
34 static AmbientLightSensor* create(ExecutionContext*, ExceptionState&);
35
36 ~AmbientLightSensor() override;
37
38 // Getters
39 AmbientLightSensorReading& reading();
40
41 // Inherited from PlatformEventController.
42 void didUpdateData() override;
43 void registerWithDispatcher() override;
44 void unregisterWithDispatcher() override;
45 bool hasLastData() override;
46
47 DECLARE_VIRTUAL_TRACE();
48
49 private:
50 AmbientLightSensor(ExecutionContext*, SensorOptions);
51 Member<AmbientLightSensorReading> m_lightReading;
52 };
53
54 } // namespace blink
55
56 #endif // AmbientLightSensor_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698