Chromium Code Reviews| Index: chrome/browser/resources/bluetooth_internals/device_details_page.js |
| diff --git a/chrome/browser/resources/bluetooth_internals/device_details_page.js b/chrome/browser/resources/bluetooth_internals/device_details_page.js |
| index 6112bf011f7e995996efe0ce5fe0e1aa178dee14..c7d6e13fb642a664dd1b24debbbde28015e8cc03 100644 |
| --- a/chrome/browser/resources/bluetooth_internals/device_details_page.js |
| +++ b/chrome/browser/resources/bluetooth_internals/device_details_page.js |
| @@ -83,6 +83,20 @@ cr.define('device_details_page', function() { |
| this.devicePtr !== null ? this.disconnect() : this.connect(); |
| }.bind(this)); |
| + this.serviceList.addEventListener( |
| + 'characteristicsrequested', function(event) { |
| + if (!this.devicePtr) { |
| + event.target.onCharacteristicsReturned([]); |
|
dpapad
2017/01/17 20:01:01
I am confused about what is happening here.
|
| + return; |
| + } |
| + |
| + this.devicePtr.getCharacteristics(event.detail.serviceId).then( |
| + function(response) { |
| + event.target.onCharacteristicsReturned( |
|
dpapad
2017/01/17 20:01:01
This strikes me as odd. Instead of calling a metho
mbrunson
2017/01/17 21:05:49
I've been juggling solutions to this issue. I'm cr
dpapad
2017/01/17 22:01:39
Firing an event from a subcomponent that propagate
mbrunson
2017/01/18 22:04:23
Ok. I've created a global service object for this,
|
| + response.characteristics); |
| + }.bind(this)); |
| + }.bind(this)); |
| + |
| this.redraw(); |
| } |
| @@ -124,7 +138,7 @@ cr.define('device_details_page', function() { |
| Snackbar.show( |
| this.deviceInfo.name_for_display + ': ' + error.message, |
| - SnackbarType.DANGER, 'Retry', this.connect.bind(this)); |
| + SnackbarType.ERROR, 'Retry', this.connect.bind(this)); |
| this.updateConnectionStatus_( |
| device_collection.ConnectionStatus.DISCONNECTED); |