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

Side by Side Diff: Source/modules/device_light/DeviceLightDispatcher.h

Issue 143823004: Implement DeviceLight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Work in Adam's comments Created 6 years, 9 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 unified diff | Download patch
OLDNEW
(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 // TODO(riju) make DeviceSensorEventDispatcher.h common to all Device Apis
9 // by extracting it out of device_orientation
10 #include "modules/device_orientation/DeviceSensorEventDispatcher.h"
11 #include "public/platform/WebDeviceLightListener.h"
12 #include "wtf/RefPtr.h"
13
14 namespace WebCore {
15
16 class DeviceLightController;
17
18 // This class listens to device light data and dispatches it to all
19 // listening controllers
20 class DeviceLightDispatcher : public DeviceSensorEventDispatcher, public blink:: WebDeviceLightListener {
Inactive 2014/03/07 19:29:52 Can be marked as FINAL
riju_ 2014/03/10 16:17:26 Done.
21 public:
22 static DeviceLightDispatcher& instance();
23
24 double latestDeviceLightData();
25
26 // This method is called every time new device light data is available.
27 virtual void didChangeDeviceLight(const double&) OVERRIDE;
Inactive 2014/03/07 19:29:52 const double& -> double?
riju_ 2014/03/10 16:17:26 Done.
28 void addDeviceLightController(DeviceLightController*);
29 void removeDeviceLightController(DeviceLightController*);
30
31 private:
32 DeviceLightDispatcher();
33 ~DeviceLightDispatcher();
Inactive 2014/03/07 19:29:52 virtual
riju_ 2014/03/10 16:17:26 Done.
34
35 virtual void startListening() OVERRIDE;
36 virtual void stopListening() OVERRIDE;
37
38 double m_lastDeviceLightData;
39 };
40
41 } // namespace WebCore
42
43 #endif // DeviceLightDispatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698