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

Unified Diff: chrome/browser/resources/options/chromeos/bluetooth_add_device_overlay.js

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 years, 6 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/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};
});

Powered by Google App Engine
This is Rietveld 408576698