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/PlatformEventDispatcher.h" | |
9 #include "platform/heap/Handle.h" | |
10 #include "public/platform/WebDeviceLightListener.h" | |
11 | |
12 namespace blink { | |
13 | |
14 // This class listens to device light data and notifies all registered | |
15 // controllers. | |
16 class DeviceLightDispatcher final | |
17 : public GarbageCollectedFinalized<DeviceLightDispatcher>, | |
18 public PlatformEventDispatcher, | |
19 public WebDeviceLightListener { | |
20 USING_GARBAGE_COLLECTED_MIXIN(DeviceLightDispatcher); | |
21 | |
22 public: | |
23 static DeviceLightDispatcher& Instance(); | |
24 ~DeviceLightDispatcher() override; | |
25 | |
26 double LatestDeviceLightData() const; | |
27 | |
28 // Inherited from WebDeviceLightListener. | |
29 void DidChangeDeviceLight(double) override; | |
30 | |
31 DECLARE_VIRTUAL_TRACE(); | |
32 | |
33 private: | |
34 DeviceLightDispatcher(); | |
35 | |
36 // Inherited from PlatformEventDispatcher. | |
37 void StartListening() override; | |
38 void StopListening() override; | |
39 | |
40 double last_device_light_data_; | |
41 }; | |
42 | |
43 } // namespace blink | |
44 | |
45 #endif // DeviceLightDispatcher_h | |
OLD | NEW |