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

Unified Diff: chrome/browser/resources/settings/device_page/device_page_browser_proxy.js

Issue 2853113004: chromeos: Add settings to control power management prefs. (Closed)
Patch Set: switch back from aria-labelledby to aria-label Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/resources/settings/device_page/power.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/resources/settings/device_page/power.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698