Index: chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
diff --git a/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js b/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
index 267ef20ef2c6a93f7701af104515562259415501..902809cd97c2093130c0d99d2bb6de5eccf5fb87 100644 |
--- a/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
+++ b/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
@@ -33,6 +33,39 @@ settings.PowerSource; |
*/ |
settings.BatteryStatus; |
+/** |
+ * Mirrors chromeos::settings::PowerHandler::IdleBehavior. |
+ * @enum {number} |
+ */ |
+settings.IdleBehavior = { |
+ DISPLAY_OFF_SLEEP: 0, |
+ DISPLAY_OFF_STAY_AWAKE: 1, |
+ DISPLAY_ON: 2, |
+ OTHER: 3, |
+}; |
+ |
+/** |
+ * Mirrors chromeos::PowerPolicyController::Action. |
+ * @enum {number} |
+ */ |
+settings.LidClosedBehavior = { |
+ SUSPEND: 0, |
+ STOP_SESSION: 1, |
+ SHUT_DOWN: 2, |
+ DO_NOTHING: 3, |
+}; |
+ |
+/** |
+ * @typedef {{ |
+ * idleBehavior: settings.IdleBehavior, |
+ * idleControlled: boolean, |
+ * lidClosedBehavior: settings.LidClosedBehavior, |
+ * lidClosedControlled: boolean, |
+ * hasLid: boolean, |
+ * }} |
+ */ |
+settings.PowerManagementSettings; |
+ |
/** |
* @typedef {{name:string, |
* value:string, |
@@ -75,6 +108,21 @@ cr.define('settings', function() { |
*/ |
setPowerSource: function(powerSourceId) {}, |
+ /** Requests the current power management settings. */ |
+ requestPowerManagementSettings: function() {}, |
+ |
+ /** |
+ * Sets the idle power management behavior. |
+ * @param {settings.IdleBehavior} behavior Idle behavior. |
+ */ |
+ setIdleBehavior: function(behavior) {}, |
+ |
+ /** |
+ * Sets the lid-closed power management behavior. |
+ * @param {settings.LidClosedBehavior} behavior Lid-closed behavior. |
+ */ |
+ setLidClosedBehavior: function(behavior) {}, |
+ |
/** |
* |callback| is run when there is new note-taking app information |
* available or after |requestNoteTakingApps| has been called. |
@@ -148,6 +196,21 @@ cr.define('settings', function() { |
chrome.send('setPowerSource', [powerSourceId]); |
}, |
+ /** @override */ |
+ requestPowerManagementSettings: function() { |
+ chrome.send('requestPowerManagementSettings'); |
+ }, |
+ |
+ /** @override */ |
+ setIdleBehavior: function(behavior) { |
+ chrome.send('setIdleBehavior', [behavior]); |
+ }, |
+ |
+ /** @override */ |
+ setLidClosedBehavior: function(behavior) { |
+ chrome.send('setLidClosedBehavior', [behavior]); |
+ }, |
+ |
/** @override */ |
setNoteTakingAppsUpdatedCallback: function(callback) { |
cr.addWebUIListener('onNoteTakingAppsUpdated', callback); |