Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.exportPath('settings'); | 5 cr.exportPath('settings'); |
| 6 | 6 |
| 7 var PairingEventType = chrome.bluetoothPrivate.PairingEventType; | 7 var PairingEventType = chrome.bluetoothPrivate.PairingEventType; |
| 8 | 8 |
| 9 // NOTE(dbeam): even though this behavior is only used privately, it must | 9 // NOTE(dbeam): even though this behavior is only used privately, it must |
| 10 // be globally accessible for Closure's --polymer_pass to compile happily. | 10 // be globally accessible for Closure's --polymer_pass to compile happily. |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 }, | 222 }, |
| 223 | 223 |
| 224 /** | 224 /** |
| 225 * @param {!chrome.bluetoothPrivate.PairingResponse} response | 225 * @param {!chrome.bluetoothPrivate.PairingResponse} response |
| 226 * @private | 226 * @private |
| 227 */ | 227 */ |
| 228 sendResponse_: function(response) { | 228 sendResponse_: function(response) { |
| 229 if (!this.pairingDevice) | 229 if (!this.pairingDevice) |
| 230 return; | 230 return; |
| 231 var options = | 231 var options = |
| 232 /** @type {!chrome.bluetoothPrivate.SetPairingResponseOptions} */ { | 232 /** @type {!chrome.bluetoothPrivate.SetPairingResponseOptions} */ { |
|
dschuyler
2017/04/19 18:58:41
This looks like it should be a four space indent.
| |
| 233 device: this.pairingDevice, | 233 device: this.pairingDevice, |
| 234 response: response | 234 response: response |
| 235 }; | 235 }; |
| 236 if (response == chrome.bluetoothPrivate.PairingResponse.CONFIRM) { | 236 if (response == chrome.bluetoothPrivate.PairingResponse.CONFIRM) { |
| 237 var pairing = this.pairingEvent_.pairing; | 237 var pairing = this.pairingEvent_.pairing; |
| 238 if (pairing == PairingEventType.REQUEST_PINCODE) | 238 if (pairing == PairingEventType.REQUEST_PINCODE) |
| 239 options.pincode = this.$$('#pincode').value; | 239 options.pincode = this.$$('#pincode').value; |
| 240 else if (pairing == PairingEventType.REQUEST_PASSKEY) | 240 else if (pairing == PairingEventType.REQUEST_PASSKEY) |
| 241 options.passkey = parseInt(this.$$('#passkey').value, 10); | 241 options.passkey = parseInt(this.$$('#passkey').value, 10); |
| 242 } | 242 } |
| 243 this.bluetoothPrivate.setPairingResponse(options, function() { | 243 this.bluetoothPrivate.setPairingResponse(options, function() { |
| 244 if (chrome.runtime.lastError) { | 244 if (chrome.runtime.lastError) { |
| 245 // TODO(stevenjb): Show error. | 245 // TODO(stevenjb): Show error. |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 this.getDialog_().cancel(); | 390 this.getDialog_().cancel(); |
| 391 }, | 391 }, |
| 392 | 392 |
| 393 /** @private */ | 393 /** @private */ |
| 394 onDialogCanceled_: function() { | 394 onDialogCanceled_: function() { |
| 395 if (this.dialogId == 'pairDevice') | 395 if (this.dialogId == 'pairDevice') |
| 396 this.sendResponse_(chrome.bluetoothPrivate.PairingResponse.CANCEL); | 396 this.sendResponse_(chrome.bluetoothPrivate.PairingResponse.CANCEL); |
| 397 this.endPairing(); | 397 this.endPairing(); |
| 398 }, | 398 }, |
| 399 }); | 399 }); |
| OLD | NEW |