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

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

Issue 2629573006: chromeos: Add Power device page to chrome://md-settings. (Closed)
Patch Set: merge Created 3 years, 10 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
Index: chrome/browser/resources/settings/device_page/device_page.js
diff --git a/chrome/browser/resources/settings/device_page/device_page.js b/chrome/browser/resources/settings/device_page/device_page.js
index 55c24f17020da6e9ef9fda90b2956e28e06ce7ae..9d4521589c4703fff4bcce75d258cdcd7885516a 100644
--- a/chrome/browser/resources/settings/device_page/device_page.js
+++ b/chrome/browser/resources/settings/device_page/device_page.js
@@ -51,43 +51,6 @@ Polymer({
},
readOnly: true,
},
-
- /** @private {string} ID of the selected power source, or ''. */
- selectedPowerSourceId_: String,
-
- /** @private {!settings.BatteryStatus|undefined} */
- batteryStatus_: Object,
-
- /** @private {boolean} Whether a low-power (USB) charger is being used. */
- lowPowerCharger_: Boolean,
-
- /**
- * List of available dual-role power sources, if enablePowerSettings_ is on.
- * @private {!Array<!settings.PowerSource>|undefined}
- */
- powerSources_: Array,
-
- /** @private */
- powerLabel_: {
- type: String,
- computed: 'computePowerLabel_(powerSources_, batteryStatus_.calculating)',
- },
-
- /** @private */
- showPowerDropdown_: {
- type: Boolean,
- computed: 'computeShowPowerDropdown_(powerSources_)',
- value: false,
- },
-
- /**
- * The name of the dedicated charging device being used, if present.
- * @private {string}
- */
- powerSourceName_: {
- type: String,
- computed: 'computePowerSourceName_(powerSources_, lowPowerCharger_)',
- },
},
observers: [
@@ -105,14 +68,6 @@ Polymer({
this.addWebUIListener(
'has-stylus-changed', this.set.bind(this, 'hasStylus_'));
settings.DevicePageBrowserProxyImpl.getInstance().initializeStylus();
-
- if (this.enablePowerSettings_) {
- this.addWebUIListener(
- 'battery-status-changed', this.set.bind(this, 'batteryStatus_'));
- this.addWebUIListener(
- 'power-sources-changed', this.powerSourcesChanged_.bind(this));
- settings.DevicePageBrowserProxyImpl.getInstance().updatePowerStatus();
- }
},
/**
@@ -130,52 +85,6 @@ Polymer({
},
/**
- * @param {*} lhs
- * @param {*} rhs
- * @return {boolean}
- */
- isEqual_: function(lhs, rhs) {
- return lhs === rhs;
- },
-
- /**
- * @param {!Array<!settings.PowerSource>|undefined} powerSources
- * @param {boolean} calculating
- * @return {string} The primary label for the power row.
- * @private
- */
- computePowerLabel_: function(powerSources, calculating) {
- return this.i18n(calculating ? 'calculatingPower' :
- powerSources.length ? 'powerSourceLabel' : 'powerSourceBattery');
- },
-
- /**
- * @param {!Array<!settings.PowerSource>} powerSources
- * @return {boolean} True if at least one power source is attached and all of
- * them are dual-role (no dedicated chargers).
- * @private
- */
- computeShowPowerDropdown_: function(powerSources) {
- return powerSources.length > 0 && powerSources.every(function(source) {
- return source.type == settings.PowerDeviceType.DUAL_ROLE_USB;
- });
- },
-
- /**
- * @param {!Array<!settings.PowerSource>} powerSources
- * @param {boolean} lowPowerCharger
- * @return {string} Description of the power source.
- * @private
- */
- computePowerSourceName_: function(powerSources, lowPowerCharger) {
- if (lowPowerCharger)
- return this.i18n('powerSourceLowPowerCharger');
- if (powerSources.length)
- return this.i18n('powerSourceAcAdapter');
- return '';
- },
-
- /**
* Handler for tapping the mouse and touchpad settings menu item.
* @private
*/
@@ -215,9 +124,12 @@ Polymer({
settings.navigateTo(settings.Route.STORAGE);
},
- onPowerSourceChange_: function() {
- settings.DevicePageBrowserProxyImpl.getInstance().setPowerSource(
- this.$$('#powerSource').value);
+ /**
+ * Handler for tapping the Power settings menu item.
+ * @private
+ */
+ onPowerTap_: function() {
+ settings.navigateTo(settings.Route.POWER);
},
/** @protected */
@@ -236,19 +148,6 @@ Polymer({
},
/**
- * @param {!Array<settings.PowerSource>} sources External power sources.
- * @param {string} selectedId The ID of the currently used power source.
- * @param {boolean} lowPowerCharger Whether the currently used power source
- * is a low-powered USB charger.
- * @private
- */
- powerSourcesChanged_: function(sources, selectedId, lowPowerCharger) {
- this.powerSources_ = sources;
- this.selectedPowerSourceId_ = selectedId;
- this.lowPowerCharger_ = lowPowerCharger;
- },
-
- /**
* Leaves the pointer subpage if all pointing devices are detached.
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698