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..cfb4d2f0dc07970aee71505acf29b8bf80e964a2 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h |
@@ -0,0 +1,71 @@ |
+// 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 "core/dom/ContextLifecycleObserver.h" |
+#include "core/frame/PlatformEventController.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/als_reading.h" |
+#include "modules/sensor/sensor_state_type.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/text/WTFString.h" |
+ |
+namespace blink { |
+ |
+class ExceptionState; |
+class ScriptState; |
+ |
+class AmbientLightSensor |
+ : public Sensor |
+ , public PlatformEventController { |
+ USING_GARBAGE_COLLECTED_MIXIN(AmbientLightSensor); |
+ DEFINE_WRAPPERTYPEINFO(); |
+ |
+public: |
+ static AmbientLightSensor* create(ExecutionContext*, SensorOptions, ExceptionState&); |
+ static AmbientLightSensor* create(ExecutionContext*, ExceptionState&); |
+ |
+ ~AmbientLightSensor() override; |
+ |
+ // From Sensor. |
+ void start(ScriptState*, ExceptionState&) override; |
+ void stop(ScriptState*, ExceptionState&) override; |
+ void updateState(SensorState) override; |
+ |
+ // Getters |
+ AmbientLightSensorReading& reading(); |
+ |
+ // Inherited from PlatformEventController. |
+ void didUpdateData() override; |
+ void registerWithDispatcher() override; |
+ void unregisterWithDispatcher() override; |
+ bool hasLastData() override; |
+ |
+ // ActiveDOMObject implementation. |
+ void suspend() override; |
+ void resume() override; |
+ void stop() override; |
+ bool hasPendingActivity() const override; |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+private: |
+ AmbientLightSensor(ExecutionContext*, SensorOptions); |
+ |
+ Member<AmbientLightSensorReading> m_lightReading; |
timvolodine
2016/05/06 17:05:41
does this mean we have two readings now? one from
riju_
2016/05/16 16:58:51
We can make SensorReading and SensorOptions privat
timvolodine
2016/05/17 17:46:18
I think the idea would be to use the member of Sen
|
+}; |
+ |
+} // namespace blink |
+ |
+#endif // AmbientLightSensor_h |