| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 | 6 * @fileoverview |
| 7 * 'settings-bluetooth-subpage' is the settings subpage for managing bluetooth | 7 * 'settings-bluetooth-subpage' is the settings subpage for managing bluetooth |
| 8 * properties and devices. | 8 * properties and devices. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 this.connectDevice_(device); | 341 this.connectDevice_(device); |
| 342 else if (action == 'disconnect') | 342 else if (action == 'disconnect') |
| 343 this.disconnectDevice_(device); | 343 this.disconnectDevice_(device); |
| 344 else if (action == 'remove') | 344 else if (action == 'remove') |
| 345 this.forgetDevice_(device); | 345 this.forgetDevice_(device); |
| 346 else | 346 else |
| 347 console.error('Unexected action: ' + action); | 347 console.error('Unexected action: ' + action); |
| 348 }, | 348 }, |
| 349 | 349 |
| 350 /** | 350 /** |
| 351 * @param {boolean} enabled |
| 352 * @param {string} onstr |
| 353 * @param {string} offstr |
| 351 * @return {string} | 354 * @return {string} |
| 352 * @private | 355 * @private |
| 353 */ | 356 */ |
| 354 getOffOnString_: function() { | 357 getOnOffString_: function(enabled, onstr, offstr) { |
| 355 return this.i18n(this.bluetoothEnabled ? 'bluetoothOn' : 'bluetoothOff'); | 358 return enabled ? onstr : offstr; |
| 356 }, | 359 }, |
| 357 | 360 |
| 358 /** | 361 /** |
| 359 * @param {boolean} bluetoothEnabled | 362 * @param {boolean} bluetoothEnabled |
| 360 * @param {!Array<!chrome.bluetooth.Device>} deviceList | 363 * @param {!Array<!chrome.bluetooth.Device>} deviceList |
| 361 * @return {boolean} | 364 * @return {boolean} |
| 362 * @private | 365 * @private |
| 363 */ | 366 */ |
| 364 showDevices_: function(bluetoothEnabled, deviceList) { | 367 showDevices_: function(bluetoothEnabled, deviceList) { |
| 365 return bluetoothEnabled && deviceList.length > 0; | 368 return bluetoothEnabled && deviceList.length > 0; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 Polymer.dom.flush(); | 467 Polymer.dom.flush(); |
| 465 this.$.deviceDialog.open(); | 468 this.$.deviceDialog.open(); |
| 466 }, | 469 }, |
| 467 | 470 |
| 468 /** @private */ | 471 /** @private */ |
| 469 onDialogClosed_: function() { | 472 onDialogClosed_: function() { |
| 470 this.dialogId_ = ''; | 473 this.dialogId_ = ''; |
| 471 this.pairingDevice_ = undefined; | 474 this.pairingDevice_ = undefined; |
| 472 }, | 475 }, |
| 473 }); | 476 }); |
| OLD | NEW |