OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/device_light/DeviceLightDispatcher.h" | 6 #include "modules/device_light/DeviceLightDispatcher.h" |
7 | 7 |
8 #include "modules/device_light/DeviceLightController.h" | 8 #include "modules/device_light/DeviceLightController.h" |
9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 { | 25 { |
26 } | 26 } |
27 | 27 |
28 DEFINE_TRACE(DeviceLightDispatcher) | 28 DEFINE_TRACE(DeviceLightDispatcher) |
29 { | 29 { |
30 PlatformEventDispatcher::trace(visitor); | 30 PlatformEventDispatcher::trace(visitor); |
31 } | 31 } |
32 | 32 |
33 void DeviceLightDispatcher::startListening() | 33 void DeviceLightDispatcher::startListening() |
34 { | 34 { |
35 Platform::current()->startListening(WebPlatformEventDeviceLight, this); | 35 Platform::current()->startListening(WebPlatformEventTypeDeviceLight, this); |
36 } | 36 } |
37 | 37 |
38 void DeviceLightDispatcher::stopListening() | 38 void DeviceLightDispatcher::stopListening() |
39 { | 39 { |
40 Platform::current()->stopListening(WebPlatformEventDeviceLight); | 40 Platform::current()->stopListening(WebPlatformEventTypeDeviceLight); |
41 m_lastDeviceLightData = -1; | 41 m_lastDeviceLightData = -1; |
42 } | 42 } |
43 | 43 |
44 void DeviceLightDispatcher::didChangeDeviceLight(double value) | 44 void DeviceLightDispatcher::didChangeDeviceLight(double value) |
45 { | 45 { |
46 m_lastDeviceLightData = value; | 46 m_lastDeviceLightData = value; |
47 notifyControllers(); | 47 notifyControllers(); |
48 } | 48 } |
49 | 49 |
50 double DeviceLightDispatcher::latestDeviceLightData() const | 50 double DeviceLightDispatcher::latestDeviceLightData() const |
51 { | 51 { |
52 return m_lastDeviceLightData; | 52 return m_lastDeviceLightData; |
53 } | 53 } |
54 | 54 |
55 } // namespace blink | 55 } // namespace blink |
OLD | NEW |