Chromium Code Reviews| 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 BatteryDispatcher_h | |
| 6 #define BatteryDispatcher_h | |
| 7 | |
| 8 #include "core/frame/DeviceSensorEventDispatcher.h" | |
| 9 #include "modules/battery/BatteryManager.h" | |
| 10 #include "modules/battery/BatteryStatus.h" | |
| 11 #include "public/platform/WebBatteryListener.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 class WebBatteryStatus; | |
| 15 } | |
| 16 | |
| 17 namespace WebCore { | |
| 18 | |
| 19 class BatteryDispatcher FINAL : public DeviceSensorEventDispatcher, public blink ::WebBatteryListener { | |
| 20 public: | |
| 21 static BatteryDispatcher& instance(); | |
| 22 virtual ~BatteryDispatcher(); | |
| 23 | |
| 24 void addClient(BatteryManager*); | |
| 25 void removeClient(BatteryManager*); | |
| 26 | |
| 27 const BatteryStatus* getLatestData(); | |
| 28 virtual void updateBatteryStatus(const blink::WebBatteryStatus&) OVERRIDE; | |
| 29 | |
| 30 private: | |
| 31 BatteryDispatcher(); | |
| 32 RefPtr<BatteryStatus> m_batteryStatus; | |
|
timvolodine
2014/04/15 14:26:53
I think the convention is to put this after constr
| |
| 33 | |
| 34 void didChangeBatteryStatus(const AtomicString& eventType); | |
| 35 | |
| 36 virtual void startListening() OVERRIDE; | |
| 37 virtual void stopListening() OVERRIDE; | |
| 38 }; | |
| 39 | |
| 40 } | |
| 41 | |
| 42 #endif // BatteryDispatcher_h | |
| OLD | NEW |