| 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 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 virtual void AddObserver(Observer* observer) = 0; | 38 virtual void AddObserver(Observer* observer) = 0; |
| 39 virtual void RemoveObserver(Observer* observer) = 0; | 39 virtual void RemoveObserver(Observer* observer) = 0; |
| 40 | 40 |
| 41 // Calculates idle time asynchronously. If it encounters some error, | 41 // Calculates idle time asynchronously. If it encounters some error, |
| 42 // it returns -1. | 42 // it returns -1. |
| 43 virtual void CalculateIdleTime(CalculateIdleTimeCallback* callback) = 0; | 43 virtual void CalculateIdleTime(CalculateIdleTimeCallback* callback) = 0; |
| 44 | 44 |
| 45 // Enable/disable screen lock for current session. | 45 // Enable/disable screen lock for current session. |
| 46 virtual void EnableScreenLock(bool enable) = 0; | 46 virtual void EnableScreenLock(bool enable) = 0; |
| 47 | 47 |
| 48 // Requests restart of the system. | |
| 49 virtual void RequestRestart() = 0; | |
| 50 | |
| 51 // Requests shutdown of the system. | |
| 52 virtual void RequestShutdown() = 0; | |
| 53 | |
| 54 // Factory function, creates a new instance and returns ownership. | 48 // Factory function, creates a new instance and returns ownership. |
| 55 // For normal usage, access the singleton via CrosLibrary::Get(). | 49 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 56 static PowerLibrary* GetImpl(bool stub); | 50 static PowerLibrary* GetImpl(bool stub); |
| 57 }; | 51 }; |
| 58 | 52 |
| 59 } // namespace chromeos | 53 } // namespace chromeos |
| 60 | 54 |
| 61 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
| OLD | NEW |