| 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 #ifndef BatteryDispatcher_h | 5 #ifndef BatteryDispatcher_h |
| 6 #define BatteryDispatcher_h | 6 #define BatteryDispatcher_h |
| 7 | 7 |
| 8 #include "core/frame/PlatformEventDispatcher.h" | 8 #include "core/frame/PlatformEventDispatcher.h" |
| 9 #include "device/battery/battery_monitor.mojom-blink.h" | 9 #include "device/battery/battery_monitor.mojom-blink.h" |
| 10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 static BatteryDispatcher& instance(); | 23 static BatteryDispatcher& instance(); |
| 24 | 24 |
| 25 const BatteryStatus* latestData() const { | 25 const BatteryStatus* latestData() const { |
| 26 return m_hasLatestData ? &m_batteryStatus : nullptr; | 26 return m_hasLatestData ? &m_batteryStatus : nullptr; |
| 27 } | 27 } |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 BatteryDispatcher(); | 30 BatteryDispatcher(); |
| 31 | 31 |
| 32 void queryNextStatus(); | 32 void queryNextStatus(); |
| 33 void onDidChange(device::blink::BatteryStatusPtr); | 33 void onDidChange(device::mojom::blink::BatteryStatusPtr); |
| 34 void updateBatteryStatus(const BatteryStatus&); | 34 void updateBatteryStatus(const BatteryStatus&); |
| 35 | 35 |
| 36 // Inherited from PlatformEventDispatcher. | 36 // Inherited from PlatformEventDispatcher. |
| 37 void startListening() override; | 37 void startListening() override; |
| 38 void stopListening() override; | 38 void stopListening() override; |
| 39 | 39 |
| 40 device::blink::BatteryMonitorPtr m_monitor; | 40 device::mojom::blink::BatteryMonitorPtr m_monitor; |
| 41 BatteryStatus m_batteryStatus; | 41 BatteryStatus m_batteryStatus; |
| 42 bool m_hasLatestData; | 42 bool m_hasLatestData; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace blink | 45 } // namespace blink |
| 46 | 46 |
| 47 #endif // BatteryDispatcher_h | 47 #endif // BatteryDispatcher_h |
| OLD | NEW |