| 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 CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ | 5 #ifndef BLINK_PLATFORM_BATTERY_BATTERY_STATUS_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ | 6 #define BLINK_PLATFORM_BATTERY_BATTERY_STATUS_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "content/common/content_export.h" | |
| 11 #include "device/battery/battery_monitor.mojom.h" | 8 #include "device/battery/battery_monitor.mojom.h" |
| 9 #include "platform/PlatformExport.h" |
| 10 #include "wtf/Noncopyable.h" |
| 12 | 11 |
| 13 namespace blink { | 12 namespace blink { |
| 14 class WebBatteryStatusListener; | |
| 15 } | |
| 16 | 13 |
| 17 namespace content { | 14 class BatteryStatusListener; |
| 18 | 15 |
| 19 class CONTENT_EXPORT BatteryStatusDispatcher { | 16 class PLATFORM_EXPORT BatteryStatusDispatcher { |
| 17 WTF_MAKE_NONCOPYABLE(BatteryStatusDispatcher); |
| 20 public: | 18 public: |
| 21 explicit BatteryStatusDispatcher(blink::WebBatteryStatusListener* listener); | 19 explicit BatteryStatusDispatcher(BatteryStatusListener*); |
| 22 ~BatteryStatusDispatcher(); | 20 ~BatteryStatusDispatcher(); |
| 23 | 21 |
| 24 private: | 22 private: |
| 25 friend class BatteryStatusDispatcherTest; | |
| 26 | |
| 27 void QueryNextStatus(); | 23 void QueryNextStatus(); |
| 28 void DidChange(device::BatteryStatusPtr battery_status); | 24 void OnDidChange(device::BatteryStatusPtr); |
| 29 | 25 |
| 30 device::BatteryMonitorPtr monitor_; | 26 device::BatteryMonitorPtr monitor_; |
| 31 blink::WebBatteryStatusListener* listener_; | 27 BatteryStatusListener* listener_; |
| 32 | 28 |
| 33 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); | 29 friend class BatteryStatusDispatcherTest; |
| 34 }; | 30 }; |
| 35 | 31 |
| 36 } // namespace content | 32 } // namespace blink |
| 37 | 33 |
| 38 #endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ | 34 #endif // BLINK_PLATFORM_BATTERY_BATTERY_STATUS_DISPATCHER_H_ |
| OLD | NEW |