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

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

Issue 553573003: Compile chrome://settings, part 3: 167 proper errors left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@G_options_errors_1
Patch Set: rebase Created 6 years, 3 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_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..8aa6f88018ee96c20086557f1dfcf94222b7f27c 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
@@ -272,17 +270,17 @@ cr.define('options.system.bluetooth', function() {
},
/**
- * Override base implementation of handleClick_, which unconditionally
+ * Override base implementation of handleClick, which unconditionally
* removes the item. In this case, removal of the element is deferred
* pending confirmation from the Bluetooth adapter.
* @param {Event} e The click event object.
- * @private
+ * @override
*/
- handleClick_: function(e) {
+ handleClick: function(e) {
if (this.disabled)
return;
- var target = e.target;
+ var target = /** @type {HTMLElement} */(e.target);
if (!target.classList.contains('row-delete-button'))
return;

Powered by Google App Engine
This is Rietveld 408576698