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

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

Issue 2388533003: bluetooth: Add AdapterInfo in Bluetooth adapter service. (Closed)
Patch Set: Fix comment 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 0e48aa25c64ef9b23d5efb3c9c96394d11db3d51..7ec816c106075f86d927bdb8d1764710ba0a8093 100644
--- a/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
+++ b/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
@@ -36,7 +36,18 @@ AdapterClient.prototype = {
var adapter, adapterClient;
/**
- * TODO: Move to shared location. See crbug.com/652361.
+ * Logs basic information retrieved from the adapter.
+ */
+ function logAdapterInfo() {
+ console.log('Getting adapter info');
dcheng 2016/10/06 18:46:28 I'm not sure what our policy on logging code is in
mbrunson 2016/10/06 21:00:22 Eventually, this JS file will turn into a setup fi
+
+ return adapter.getInfo().then(function(response) {
+ console.log(response.info);
+ });
+ }
+
+ /**
+ * TODO: Move to shared location. See http://crbug.com/652361.
* Helper to convert callback-based define() API to a promise-based API.
* @param {!Array<string>} moduleNames
* @return {!Promise}
@@ -89,6 +100,7 @@ AdapterClient.prototype = {
document.addEventListener('DOMContentLoaded', function() {
initializeProxies()
+ .then(logAdapterInfo)
dpapad 2016/10/06 22:25:21 Let's be consistent within this file. Either init
mbrunson 2016/10/07 00:48:11 Alright. Thanks for the link. Latter looks better
.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