OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_SYSTEM_POWER_POWER_SUPPLY_STATUS_H_ | 5 #ifndef ASH_SYSTEM_POWER_POWER_SUPPLY_STATUS_H_ |
6 #define ASH_SYSTEM_POWER_POWER_SUPPLY_STATUS_H_ | 6 #define ASH_SYSTEM_POWER_POWER_SUPPLY_STATUS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 | 12 |
| 13 #if defined(OS_CHROMEOS) |
| 14 #include "chromeos/dbus/power_supply_status.h" |
| 15 #endif |
| 16 |
13 namespace ash { | 17 namespace ash { |
14 | 18 |
| 19 #if defined(OS_CHROMEOS) |
| 20 typedef chromeos::PowerSupplyStatus PowerSupplyStatus; |
| 21 #else |
| 22 // Define local struct when not building for Chrome OS. |
15 struct ASH_EXPORT PowerSupplyStatus { | 23 struct ASH_EXPORT PowerSupplyStatus { |
16 bool line_power_on; | 24 bool line_power_on; |
17 | 25 |
18 bool battery_is_present; | 26 bool battery_is_present; |
19 bool battery_is_full; | 27 bool battery_is_full; |
20 | 28 |
21 // Time in seconds until the battery is empty or full, 0 for unknown. | 29 // Time in seconds until the battery is empty or full, 0 for unknown. |
22 int64 battery_seconds_to_empty; | 30 int64 battery_seconds_to_empty; |
23 int64 battery_seconds_to_full; | 31 int64 battery_seconds_to_full; |
24 | 32 |
25 double battery_percentage; | 33 double battery_percentage; |
26 | 34 |
27 PowerSupplyStatus(); | 35 PowerSupplyStatus(); |
28 std::string ToString() const; | 36 std::string ToString() const; |
29 }; | 37 }; |
| 38 #endif // defined(OS_CHROMEOS) |
30 | 39 |
31 } // namespace ash | 40 } // namespace ash |
32 | 41 |
33 #endif // ASH_SYSTEM_POWER_POWER_SUPPLY_STATUS_H_ | 42 #endif // ASH_SYSTEM_POWER_POWER_SUPPLY_STATUS_H_ |
OLD | NEW |