Index: chrome/browser/resources/options/chromeos/bluetooth_add_device_overlay.js |
diff --git a/chrome/browser/resources/options/chromeos/bluetooth_add_device_overlay.js b/chrome/browser/resources/options/chromeos/bluetooth_add_device_overlay.js |
index 323a31fbb07d570e853ba0c88ea4bddffb914bbb..8f14a6f1feddc741d3e1ac72b9dd7241fdfd262c 100644 |
--- a/chrome/browser/resources/options/chromeos/bluetooth_add_device_overlay.js |
+++ b/chrome/browser/resources/options/chromeos/bluetooth_add_device_overlay.js |
@@ -12,9 +12,10 @@ cr.define('options', function() { |
* @extends {cr.ui.pageManager.Page} |
*/ |
function BluetoothOptions() { |
- Page.call(this, 'bluetooth', |
- loadTimeData.getString('bluetoothOptionsPageTabTitle'), |
- 'bluetooth-options'); |
+ Page.call( |
+ this, 'bluetooth', |
+ loadTimeData.getString('bluetoothOptionsPageTabTitle'), |
+ 'bluetooth-options'); |
} |
cr.addSingletonGetter(BluetoothOptions); |
@@ -40,30 +41,34 @@ cr.define('options', function() { |
var self = this; |
$('bluetooth-add-device-apply-button').onclick = function(event) { |
- chrome.send('coreOptionsUserMetricsAction', |
- ['Options_BluetoothConnectNewDevice']); |
+ chrome.send( |
+ 'coreOptionsUserMetricsAction', |
+ ['Options_BluetoothConnectNewDevice']); |
var device = self.deviceList_.selectedItem; |
PageManager.closeOverlay(); |
options.BluetoothPairing.connect(device, true); |
}; |
- $('bluetooth-unpaired-devices-list').addEventListener('change', |
- function() { |
- var item = $('bluetooth-unpaired-devices-list').selectedItem; |
- // The "bluetooth-add-device-apply-button" should be enabled for devices |
- // that can be paired or remembered. Devices not supporting pairing will |
- // be just remembered and later reported as "item.paired" = true. The |
- // button should be disabled in any other case: |
- // * No item is selected (item is undefined). |
- // * Paired devices (item.paired is true) are already paired and a new |
- // pairing attempt will fail. Paired devices could appear in this list |
- // shortly after the pairing initiated in another window finishes. |
- // * "Connecting" devices (item.connecting is true) are in the process |
- // of a pairing or connection. Another attempt to pair before the |
- // ongoing pair finishes will fail, so the button should be disabled. |
- var disabled = !item || item.paired || item.connecting; |
- $('bluetooth-add-device-apply-button').disabled = disabled; |
- }); |
+ $('bluetooth-unpaired-devices-list') |
+ .addEventListener('change', function() { |
+ var item = $('bluetooth-unpaired-devices-list').selectedItem; |
+ // The "bluetooth-add-device-apply-button" should be enabled for |
+ // devices that can be paired or remembered. Devices not supporting |
+ // pairing will be just remembered and later reported as |
+ // "item.paired" = true. The button should be disabled in any other |
+ // case: * No item is selected (item is undefined). * Paired devices |
+ // (item.paired is true) are already paired and a new |
+ // pairing attempt will fail. Paired devices could appear in this |
+ // list shortly after the pairing initiated in another window |
+ // finishes. |
+ // * "Connecting" devices (item.connecting is true) are in the |
+ // process |
+ // of a pairing or connection. Another attempt to pair before the |
+ // ongoing pair finishes will fail, so the button should be |
+ // disabled. |
+ var disabled = !item || item.paired || item.connecting; |
+ $('bluetooth-add-device-apply-button').disabled = disabled; |
+ }); |
}, |
/** @override */ |
@@ -87,8 +92,7 @@ cr.define('options', function() { |
chrome.runtime.lastError.message != 'Failed to stop discovery') { |
console.log( |
'Unexpected error calling bluetooth.stopDiscovery: ' + |
- chrome.runtime.lastError.message); |
- |
+ chrome.runtime.lastError.message); |
} |
}); |
}, |
@@ -100,8 +104,8 @@ cr.define('options', function() { |
createDeviceList_: function() { |
var deviceList = $('bluetooth-unpaired-devices-list'); |
options.system.bluetooth.BluetoothDeviceList.decorate(deviceList); |
- this.deviceList_ = assertInstanceof(deviceList, |
- options.DeletableItemList); |
+ this.deviceList_ = |
+ assertInstanceof(deviceList, options.DeletableItemList); |
} |
}; |
@@ -125,7 +129,5 @@ cr.define('options', function() { |
}; |
// Export |
- return { |
- BluetoothOptions: BluetoothOptions |
- }; |
+ return {BluetoothOptions: BluetoothOptions}; |
}); |