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 #ifndef DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_ | 4 #ifndef SERVICES_DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_ |
5 #define DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_ | 5 #define SERVICES_DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_ |
6 | 6 |
7 #include "device/battery/battery_export.h" | 7 #include "services/device/battery/battery_status_manager.h" |
8 #include "device/battery/battery_status.mojom.h" | 8 #include "services/device/public/interfaces/battery_status.mojom.h" |
9 #include "device/battery/battery_status_manager.h" | |
10 | 9 |
11 namespace dbus { | 10 namespace dbus { |
12 class Bus; | 11 class Bus; |
13 } // namespace dbus | 12 } // namespace dbus |
14 | 13 |
15 namespace device { | 14 namespace device { |
16 // UPowerDeviceState reflects the possible UPower.Device.State values, | 15 // UPowerDeviceState reflects the possible UPower.Device.State values, |
17 // see upower.freedesktop.org/docs/Device.html#Device:State. | 16 // see upower.freedesktop.org/docs/Device.html#Device:State. |
18 enum UPowerDeviceState { | 17 enum UPowerDeviceState { |
19 UPOWER_DEVICE_STATE_UNKNOWN = 0, | 18 UPOWER_DEVICE_STATE_UNKNOWN = 0, |
(...skipping 13 matching lines...) Expand all Loading... |
33 UPOWER_DEVICE_TYPE_BATTERY = 2, | 32 UPOWER_DEVICE_TYPE_BATTERY = 2, |
34 UPOWER_DEVICE_TYPE_UPS = 3, | 33 UPOWER_DEVICE_TYPE_UPS = 3, |
35 UPOWER_DEVICE_TYPE_MONITOR = 4, | 34 UPOWER_DEVICE_TYPE_MONITOR = 4, |
36 UPOWER_DEVICE_TYPE_MOUSE = 5, | 35 UPOWER_DEVICE_TYPE_MOUSE = 5, |
37 UPOWER_DEVICE_TYPE_KEYBOARD = 6, | 36 UPOWER_DEVICE_TYPE_KEYBOARD = 6, |
38 UPOWER_DEVICE_TYPE_PDA = 7, | 37 UPOWER_DEVICE_TYPE_PDA = 7, |
39 UPOWER_DEVICE_TYPE_PHONE = 8, | 38 UPOWER_DEVICE_TYPE_PHONE = 8, |
40 }; | 39 }; |
41 | 40 |
42 // Creates a notification thread and delegates Start/Stop calls to it. | 41 // Creates a notification thread and delegates Start/Stop calls to it. |
43 class DEVICE_BATTERY_EXPORT BatteryStatusManagerLinux | 42 class BatteryStatusManagerLinux : public BatteryStatusManager { |
44 : public BatteryStatusManager { | |
45 public: | 43 public: |
46 explicit BatteryStatusManagerLinux( | 44 explicit BatteryStatusManagerLinux( |
47 const BatteryStatusService::BatteryUpdateCallback& callback); | 45 const BatteryStatusService::BatteryUpdateCallback& callback); |
48 ~BatteryStatusManagerLinux() override; | 46 ~BatteryStatusManagerLinux() override; |
49 | 47 |
50 private: | 48 private: |
51 friend class BatteryStatusManagerLinuxTest; | 49 friend class BatteryStatusManagerLinuxTest; |
52 class BatteryStatusNotificationThread; | 50 class BatteryStatusNotificationThread; |
53 | 51 |
54 // BatteryStatusManager: | 52 // BatteryStatusManager: |
(...skipping 10 matching lines...) Expand all Loading... |
65 dbus::Bus* bus); | 63 dbus::Bus* bus); |
66 | 64 |
67 BatteryStatusService::BatteryUpdateCallback callback_; | 65 BatteryStatusService::BatteryUpdateCallback callback_; |
68 std::unique_ptr<BatteryStatusNotificationThread> notifier_thread_; | 66 std::unique_ptr<BatteryStatusNotificationThread> notifier_thread_; |
69 | 67 |
70 DISALLOW_COPY_AND_ASSIGN(BatteryStatusManagerLinux); | 68 DISALLOW_COPY_AND_ASSIGN(BatteryStatusManagerLinux); |
71 }; | 69 }; |
72 | 70 |
73 } // namespace device | 71 } // namespace device |
74 | 72 |
75 #endif // DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_ | 73 #endif // SERVICES_DEVICE_BATTERY_BATTERY_STATUS_MANAGER_LINUX_H_ |
OLD | NEW |