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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
new file mode 100644
index 0000000000000000000000000000000000000000..df2de29dd3f7dffd9bdf69514f45aa4ba3b8a3f5
--- /dev/null
+++ b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
@@ -0,0 +1,56 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef AmbientLightSensor_h
+#define AmbientLightSensor_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseProperty.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/ActiveDOMObject.h"
+#include "modules/EventTargetModules.h"
+#include "modules/ModulesExport.h"
+#include "modules/sensor/AmbientLightSensorReading.h"
+#include "modules/sensor/Sensor.h"
+#include "modules/sensor/SensorOptions.h"
+#include "modules/sensor/SensorState.h"
+#include "modules/sensor/als_reading.h"
+#include "platform/heap/Handle.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class ExceptionState;
+class ScriptState;
+
+class AmbientLightSensor
+ : public Sensor {
+ USING_GARBAGE_COLLECTED_MIXIN(AmbientLightSensor);
+ DEFINE_WRAPPERTYPEINFO();
+
+public:
+ static AmbientLightSensor* create(ExecutionContext*, SensorOptions, ExceptionState&);
+ static AmbientLightSensor* create(ExecutionContext*, ExceptionState&);
+
+ ~AmbientLightSensor() override;
+
+ // Getters
+ AmbientLightSensorReading& reading();
+
+ // Inherited from PlatformEventController.
+ void didUpdateData() override;
+ void registerWithDispatcher() override;
+ void unregisterWithDispatcher() override;
+ bool hasLastData() override;
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ AmbientLightSensor(ExecutionContext*, SensorOptions);
+ Member<AmbientLightSensorReading> m_lightReading;
+};
+
+} // namespace blink
+
+#endif // AmbientLightSensor_h
« 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