| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
| 6 * @fileoverview 'settings-device-page' is the settings page for device and | 6 * @fileoverview 'settings-device-page' is the settings page for device and |
| 7 * peripheral settings. | 7 * peripheral settings. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-device-page', | 10 is: 'settings-device-page', |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 return source.type == settings.PowerDeviceType.DUAL_ROLE_USB; | 212 return source.type == settings.PowerDeviceType.DUAL_ROLE_USB; |
| 213 }); | 213 }); |
| 214 }, | 214 }, |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * @param {!Array<!settings.PowerSource>} powerSources | 217 * @param {!Array<!settings.PowerSource>} powerSources |
| 218 * @param {boolean} lowPowerCharger | 218 * @param {boolean} lowPowerCharger |
| 219 * @return {string} Description of the power source. | 219 * @return {string} Description of the power source. |
| 220 * @private | 220 * @private |
| 221 */ | 221 */ |
| 222 computePowerSourceName_(powerSources, lowPowerCharger) { | 222 computePowerSourceName_: function (powerSources, lowPowerCharger) { |
| 223 if (lowPowerCharger) | 223 if (lowPowerCharger) |
| 224 return this.i18n('powerSourceLowPowerCharger'); | 224 return this.i18n('powerSourceLowPowerCharger'); |
| 225 if (powerSources.length) | 225 if (powerSources.length) |
| 226 return this.i18n('powerSourceAcAdapter'); | 226 return this.i18n('powerSourceAcAdapter'); |
| 227 return ''; | 227 return ''; |
| 228 }, | 228 }, |
| 229 | 229 |
| 230 /** | 230 /** |
| 231 * Handler for tapping the mouse and touchpad settings menu item. | 231 * Handler for tapping the mouse and touchpad settings menu item. |
| 232 * @private | 232 * @private |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 * @private | 305 * @private |
| 306 */ | 306 */ |
| 307 checkPointerSubpage_: function() { | 307 checkPointerSubpage_: function() { |
| 308 // Check that the properties have explicitly been set to false. | 308 // Check that the properties have explicitly been set to false. |
| 309 if (this.hasMouse_ === false && this.hasTouchpad_ === false && | 309 if (this.hasMouse_ === false && this.hasTouchpad_ === false && |
| 310 settings.getCurrentRoute() == settings.Route.POINTERS) { | 310 settings.getCurrentRoute() == settings.Route.POINTERS) { |
| 311 settings.navigateTo(settings.Route.DEVICE); | 311 settings.navigateTo(settings.Route.DEVICE); |
| 312 } | 312 } |
| 313 }, | 313 }, |
| 314 }); | 314 }); |
| OLD | NEW |