Chromium Code Reviews| Index: chrome/browser/resources/options/chromeos/bluetooth_device_list.js |
| diff --git a/chrome/browser/resources/options/chromeos/bluetooth_device_list.js b/chrome/browser/resources/options/chromeos/bluetooth_device_list.js |
| index a7cadb837d4171531d53f20a39e451cfe72f7271..6b089abcf71a950d53f4e6dc7c85f9aa676cd4c3 100644 |
| --- a/chrome/browser/resources/options/chromeos/bluetooth_device_list.js |
| +++ b/chrome/browser/resources/options/chromeos/bluetooth_device_list.js |
| @@ -2,6 +2,20 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +/** |
| + * @typedef {{name: string, |
| + * address: string, |
| + * paired: boolean, |
| + * connected: boolean, |
| + * connecting: boolean, |
| + * connectable: boolean, |
| + * pairing: (string|undefined), |
| + * passkey: (number|undefined), |
| + * pincode: (string|undefined), |
| + * entered: (number|undefined)}} |
| + */ |
| +var BluetoothDevice; |
| + |
| cr.define('options.system.bluetooth', function() { |
| /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| /** @const */ var DeletableItem = options.DeletableItem; |
| @@ -15,17 +29,7 @@ cr.define('options.system.bluetooth', function() { |
| /** |
| * Creates a new bluetooth list item. |
| - * @param {{name: string, |
| - * address: string, |
| - * paired: boolean, |
| - * connected: boolean, |
| - * connecting: boolean, |
| - * connectable: boolean, |
| - * pairing: (string|undefined), |
| - * passkey: (number|undefined), |
| - * pincode: (string|undefined), |
| - * entered: (number|undefined)}} device |
| - * Description of the Bluetooth device. |
| + * @param {BluetoothDevice} device Description of the Bluetooth device. |
| * @constructor |
| * @extends {options.DeletableItem} |
| */ |
| @@ -47,16 +51,7 @@ cr.define('options.system.bluetooth', function() { |
| /** |
| * Description of the Bluetooth device. |
| - * @type {{name: string, |
| - * address: string, |
| - * paired: boolean, |
| - * connected: boolean, |
| - * connecting: boolean, |
| - * connectable: boolean, |
| - * pairing: string|undefined, |
| - * passkey: number|undefined, |
| - * pincode: string|undefined, |
| - * entered: number|undefined}} |
| + * @type {?BluetoothDevice} |
| */ |
| data: null, |
| @@ -141,10 +136,10 @@ cr.define('options.system.bluetooth', function() { |
| * connected: boolean, |
| * connecting: boolean, |
| * connectable: boolean, |
| - * pairing: string|undefined, |
| - * passkey: number|undefined, |
| - * pincode: string|undefined, |
| - * entered: number|undefined}} device |
| + * pairing: (string|undefined), |
| + * passkey: (number|undefined), |
| + * pincode: (string|undefined), |
| + * entered: (number|undefined)}} device |
| * Description of the bluetooth device. |
| * @return {boolean} True if the devies was successfully added or updated. |
| */ |
| @@ -184,14 +179,14 @@ cr.define('options.system.bluetooth', function() { |
| /** |
| * Retrieves the address of the selected device, or null if no device is |
| * selected. |
| - * @return {?string} Address of selected device or null. |
| + * @return {(string|undefined)} Address of selected device or null. |
| * @private |
| */ |
| getSelectedDevice_: function() { |
| var selection = this.selectedItem; |
| if (selection) |
| return selection.address; |
| - return null; |
| + return undefined; |
| }, |
| /** |
| @@ -229,7 +224,10 @@ cr.define('options.system.bluetooth', function() { |
| } |
| }, |
| - /** @override */ |
| + /** |
| + * @override |
| + * @param {BluetoothDevice} entry |
| + */ |
| createItem: function(entry) { |
| return new BluetoothListItem(entry); |
| }, |
| @@ -250,7 +248,7 @@ cr.define('options.system.bluetooth', function() { |
| return { |
| height: this.itemHeight_, |
| marginTop: 0, |
| - marginBotton: 0, |
| + marginBottom: 0, |
| width: this.itemWidth_, |
| marginLeft: 0, |
| marginRight: 0 |
| @@ -282,7 +280,7 @@ cr.define('options.system.bluetooth', function() { |
| if (this.disabled) |
| return; |
| - var target = e.target; |
| + var target = /** @type {HTMLElement} */(e.target); |
|
Dan Beam
2014/09/11 05:26:12
generally this is right because of where the base
Vitaly Pavlenko
2014/09/11 21:12:31
Yes, I think it's right on specific methods like |
|
| if (!target.classList.contains('row-delete-button')) |
| return; |