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

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

Issue 9837075: Move power_supply_status.* from src/ash to src/chromeos (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 8 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
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 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h" 12 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h"
13 13
14 #if defined(USE_ASH) 14 #include "chromeos/dbus/power_supply_status.h"
15 #include "ash/system/power/power_supply_status.h"
16 #endif
17 15
18 namespace base { 16 namespace base {
19 class TimeTicks; 17 class TimeTicks;
20 } 18 }
21 namespace dbus { 19 namespace dbus {
22 class Bus; 20 class Bus;
23 } 21 }
24 22
25 namespace chromeos { 23 namespace chromeos {
26 24
27 #if defined(USE_ASH)
28 typedef struct ash::PowerSupplyStatus PowerSupplyStatus;
29 #else
30 // This is the local struct that is used in Chrome.
31 struct PowerSupplyStatus {
32 bool line_power_on;
33
34 bool battery_is_present;
35 bool battery_is_full;
36
37 // Time in seconds until the battery is empty or full, 0 for unknown.
38 int64 battery_seconds_to_empty;
39 int64 battery_seconds_to_full;
40
41 double battery_percentage;
42
43 PowerSupplyStatus();
44 std::string ToString() const;
45 };
46 #endif
47
48 // Callback used for processing the idle time. The int64 param is the number of 25 // Callback used for processing the idle time. The int64 param is the number of
49 // seconds the user has been idle. 26 // seconds the user has been idle.
50 typedef base::Callback<void(int64)> CalculateIdleTimeCallback; 27 typedef base::Callback<void(int64)> CalculateIdleTimeCallback;
51 typedef base::Callback<void(void)> IdleNotificationCallback; 28 typedef base::Callback<void(void)> IdleNotificationCallback;
52 typedef base::Callback<void(uint32)> PowerStateRequestIdCallback; 29 typedef base::Callback<void(uint32)> PowerStateRequestIdCallback;
53 30
54 // Callback used for getting the current screen brightness. The param is in the 31 // Callback used for getting the current screen brightness. The param is in the
55 // range [0.0, 100.0]. 32 // range [0.0, 100.0].
56 typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback; 33 typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback;
57 34
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Create() should be used instead. 173 // Create() should be used instead.
197 PowerManagerClient(); 174 PowerManagerClient();
198 175
199 private: 176 private:
200 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); 177 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient);
201 }; 178 };
202 179
203 } // namespace chromeos 180 } // namespace chromeos
204 181
205 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 182 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_delegate.h ('k') | chrome/browser/chromeos/dbus/power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698