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

Unified Diff: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js

Issue 2388533003: bluetooth: Add AdapterInfo in Bluetooth adapter service. (Closed)
Patch Set: Update mojom comments Created 4 years, 2 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
« no previous file with comments | « no previous file | device/bluetooth/adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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); });
« no previous file with comments | « no previous file | device/bluetooth/adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698