OLD | NEW |
---|---|
(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 DeviceLightDispatcher_h | |
6 #define DeviceLightDispatcher_h | |
7 | |
8 #include "core/frame/DeviceSensorEventDispatcher.h" | |
9 #include "public/platform/WebDeviceLightListener.h" | |
10 #include "wtf/RefPtr.h" | |
11 | |
12 namespace WebCore { | |
13 | |
14 class DeviceLightController; | |
15 | |
16 // This class listens to device light data and dispatches it to all | |
17 // listening controllers | |
18 class DeviceLightDispatcher FINAL : public DeviceSensorEventDispatcher, public b link::WebDeviceLightListener { | |
19 public: | |
20 static DeviceLightDispatcher& instance(); | |
21 | |
22 double latestDeviceLightData() const; | |
23 | |
24 // This method is called every time new device light data is available. | |
25 virtual void didChangeDeviceLight(const double) OVERRIDE; | |
26 void addDeviceLightController(DeviceLightController*); | |
27 void removeDeviceLightController(DeviceLightController*); | |
28 | |
29 private: | |
30 DeviceLightDispatcher(); | |
31 virtual ~DeviceLightDispatcher(); | |
32 | |
33 virtual void startListening() OVERRIDE; | |
34 virtual void stopListening() OVERRIDE; | |
35 | |
36 double m_lastDeviceLightData; | |
timvolodine
2014/04/10 12:43:13
is this initialized somewhere? preferably such tha
riju_
2014/04/10 14:10:41
Done.
Initializing m_lastDeviceLightData = -1 in t
| |
37 }; | |
38 | |
39 } // namespace WebCore | |
40 | |
41 #endif // DeviceLightDispatcher_h | |
OLD | NEW |