Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: chrome/browser/chromeos/dbus/power_manager_client.h

Issue 9562008: ash uber tray: Add entry for power and date. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 6 #define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 12
13 #if defined(USE_ASH)
14 #include "ash/system/power/power_supply_status.h"
15 #endif
16
13 namespace base { 17 namespace base {
14 class TimeTicks; 18 class TimeTicks;
15 } 19 }
16 namespace dbus { 20 namespace dbus {
17 class Bus; 21 class Bus;
18 } 22 }
19 23
20 namespace chromeos { 24 namespace chromeos {
21 25
26 #if defined(USE_ASH)
27 typedef struct ash::PowerSupplyStatus PowerSupplyStatus;
28 #else
22 // This is the local struct that is used in Chrome. 29 // This is the local struct that is used in Chrome.
23 struct PowerSupplyStatus { 30 struct PowerSupplyStatus {
24 bool line_power_on; 31 bool line_power_on;
25 32
26 bool battery_is_present; 33 bool battery_is_present;
27 bool battery_is_full; 34 bool battery_is_full;
28 35
29 // Time in seconds until the battery is empty or full, 0 for unknown. 36 // Time in seconds until the battery is empty or full, 0 for unknown.
30 int64 battery_seconds_to_empty; 37 int64 battery_seconds_to_empty;
31 int64 battery_seconds_to_full; 38 int64 battery_seconds_to_full;
32 39
33 double battery_percentage; 40 double battery_percentage;
34 41
35 PowerSupplyStatus(); 42 PowerSupplyStatus();
36 std::string ToString() const; 43 std::string ToString() const;
37 }; 44 };
45 #endif
38 46
39 // Callback used for processing the idle time. The int64 param is the number of 47 // Callback used for processing the idle time. The int64 param is the number of
40 // seconds the user has been idle. 48 // seconds the user has been idle.
41 typedef base::Callback<void(int64)> CalculateIdleTimeCallback; 49 typedef base::Callback<void(int64)> CalculateIdleTimeCallback;
42 typedef base::Callback<void(void)> IdleNotificationCallback; 50 typedef base::Callback<void(void)> IdleNotificationCallback;
43 51
44 // PowerManagerClient is used to communicate with the power manager. 52 // PowerManagerClient is used to communicate with the power manager.
45 class PowerManagerClient { 53 class PowerManagerClient {
46 public: 54 public:
47 // Interface for observing changes from the power manager. 55 // Interface for observing changes from the power manager.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Create() should be used instead. 159 // Create() should be used instead.
152 PowerManagerClient(); 160 PowerManagerClient();
153 161
154 private: 162 private:
155 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); 163 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient);
156 }; 164 };
157 165
158 } // namespace chromeos 166 } // namespace chromeos
159 167
160 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 168 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698