| 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 CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 6 #define 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 "chromeos/chromeos_export.h" |
| 13 #include "chromeos/dbus/dbus_client_implementation_type.h" |
| 13 | 14 |
| 14 #include "chromeos/dbus/power_supply_status.h" | 15 #include "chromeos/dbus/power_supply_status.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class TimeTicks; | 18 class TimeTicks; |
| 18 } | 19 } |
| 19 namespace dbus { | 20 namespace dbus { |
| 20 class Bus; | 21 class Bus; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace chromeos { |
| 24 | 25 |
| 25 // Callback used for processing the idle time. The int64 param is the number of | 26 // Callback used for processing the idle time. The int64 param is the number of |
| 26 // seconds the user has been idle. | 27 // seconds the user has been idle. |
| 27 typedef base::Callback<void(int64)> CalculateIdleTimeCallback; | 28 typedef base::Callback<void(int64)> CalculateIdleTimeCallback; |
| 28 typedef base::Callback<void(void)> IdleNotificationCallback; | 29 typedef base::Callback<void(void)> IdleNotificationCallback; |
| 29 typedef base::Callback<void(uint32)> PowerStateRequestIdCallback; | 30 typedef base::Callback<void(uint32)> PowerStateRequestIdCallback; |
| 30 | 31 |
| 31 // Callback used for getting the current screen brightness. The param is in the | 32 // Callback used for getting the current screen brightness. The param is in the |
| 32 // range [0.0, 100.0]. | 33 // range [0.0, 100.0]. |
| 33 typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback; | 34 typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback; |
| 34 | 35 |
| 35 // PowerManagerClient is used to communicate with the power manager. | 36 // PowerManagerClient is used to communicate with the power manager. |
| 36 class PowerManagerClient { | 37 class CHROMEOS_EXPORT PowerManagerClient { |
| 37 public: | 38 public: |
| 38 // Interface for observing changes from the power manager. | 39 // Interface for observing changes from the power manager. |
| 39 class Observer { | 40 class Observer { |
| 40 public: | 41 public: |
| 41 virtual ~Observer() {} | 42 virtual ~Observer() {} |
| 42 | 43 |
| 43 // Called when the brightness is changed. | 44 // Called when the brightness is changed. |
| 44 // |level| is of the range [0, 100]. | 45 // |level| is of the range [0, 100]. |
| 45 // |user_initiated| is true if the action is initiated by the user. | 46 // |user_initiated| is true if the action is initiated by the user. |
| 46 virtual void BrightnessChanged(int level, bool user_initiated) {} | 47 virtual void BrightnessChanged(int level, bool user_initiated) {} |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 protected: | 173 protected: |
| 173 // Create() should be used instead. | 174 // Create() should be used instead. |
| 174 PowerManagerClient(); | 175 PowerManagerClient(); |
| 175 | 176 |
| 176 private: | 177 private: |
| 177 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 178 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 } // namespace chromeos | 181 } // namespace chromeos |
| 181 | 182 |
| 182 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 183 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |