Chromium Code Reviews| Index: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js |
| diff --git a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js |
| index 2c8753ad1b5bf7816247a809b76196e7ddad9ef3..024fedbb04d8b53e88ad55970a59b01201f3a060 100644 |
| --- a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js |
| +++ b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js |
| @@ -39,6 +39,15 @@ AdapterClient.prototype = { |
| /** |
| * TODO: Move to shared location. See crbug.com/652361. |
| + * Logs basic information retrieved from the adapter. |
| + */ |
| + function logAdapterInfo() { |
| + console.log('Getting adapter info'); |
| + |
| + adapter.getInfo().then(function(response) { console.log(response.info); }); |
|
ortuno
2016/10/06 01:52:21
Q: Did you mean to return the promise here? Or is
mbrunson
2016/10/06 17:45:01
I didn't return it because I didn't care what orde
|
| + } |
| + |
| + /** |
| * Helper to convert callback-based define() API to a promise-based API. |
| * @param {!Array<string>} moduleNames |
| * @return {!Promise} |
| @@ -90,6 +99,7 @@ AdapterClient.prototype = { |
| document.addEventListener('DOMContentLoaded', function() { |
| initializeProxies() |
| + .then(function() { logAdapterInfo(); }) |
|
ortuno
2016/10/06 01:52:21
nit: Can you just do:
.then(logAdapterInfo)
?
mbrunson
2016/10/06 17:45:01
Done.
|
| .then(function() { return adapter.getDevices(); }) |
| .then(function(response) { console.log(response.devices); }) |
| .catch(function(error) { console.error(error); }); |