| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CROS_POWER_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // TODO(sque): Move to chrome/browser/chromeos/system, crosbug.com/16558 | 9 // TODO(sque): Move to chrome/browser/chromeos/system, crosbug.com/16558 |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 | 12 |
| 13 namespace base { | |
| 14 class TimeDelta; | |
| 15 } | |
| 16 | |
| 17 namespace chromeos { | 13 namespace chromeos { |
| 18 | 14 |
| 19 typedef base::Callback<void(int64_t)> CalculateIdleTimeCallback; | 15 typedef base::Callback<void(int64_t)> CalculateIdleTimeCallback; |
| 20 | 16 |
| 21 // This interface defines interaction with the ChromeOS power library APIs. | 17 // This interface defines interaction with the ChromeOS power library APIs. |
| 22 // Classes can add themselves as observers. Users can get an instance of this | 18 // Classes can add themselves as observers. Users can get an instance of this |
| 23 // library class like this: chromeos::CrosLibrary::Get()->GetPowerLibrary() | 19 // library class like this: chromeos::CrosLibrary::Get()->GetPowerLibrary() |
| 24 class PowerLibrary { | 20 class PowerLibrary { |
| 25 public: | 21 public: |
| 26 class Observer { | 22 class Observer { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 virtual void EnableScreenLock(bool enable) = 0; | 42 virtual void EnableScreenLock(bool enable) = 0; |
| 47 | 43 |
| 48 // Factory function, creates a new instance and returns ownership. | 44 // Factory function, creates a new instance and returns ownership. |
| 49 // For normal usage, access the singleton via CrosLibrary::Get(). | 45 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 50 static PowerLibrary* GetImpl(bool stub); | 46 static PowerLibrary* GetImpl(bool stub); |
| 51 }; | 47 }; |
| 52 | 48 |
| 53 } // namespace chromeos | 49 } // namespace chromeos |
| 54 | 50 |
| 55 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ | 51 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
| OLD | NEW |