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

Side by Side Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js

Issue 2725463002: MD Settings: Update Bluetooth toggle UI to match spec. (Closed)
Patch Set: Elim unused IDS Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698