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

Unified Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js

Issue 2643653003: MD Settings: Bluetooth: Use labels instead of icons to show connection status. (Closed)
Patch Set: Fix closure compiler error. Created 3 years, 11 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
Index: chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
index 8816fd12e8d9d027cd027f3e9c6523b901d75598..fb87d7a0209fc90eb49ab822adbfeb5dff6cedc0 100644
--- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
+++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
@@ -71,6 +71,28 @@ Polymer({
/**
* @param {!chrome.bluetooth.Device} device
+ * @return {string} The text to display the connection status of |device|.
+ * @private
+ */
+ getConnectionStatusText_: function(device) {
+ if (!this.hasConnectionStatusText_(device))
+ return '';
+ return this.i18n(
+ device.connected ? 'bluetoothConnected' : 'bluetoothNotConnected');
+ },
+
+ /**
+ * @param {!chrome.bluetooth.Device} device
+ * @return {boolean} True if connection status should be shown as the
+ * secondary text of the |device| in device list.
+ * @private
+ */
+ hasConnectionStatusText_: function(device) {
+ return !!device.paired && !device.connecting;
fukino 2017/01/19 21:11:25 device.paired is {boolean|undefined}, so I needed
stevenjb 2017/01/19 22:11:02 This is correct.
+ },
+
+ /**
+ * @param {!chrome.bluetooth.Device} device
* @return {boolean}
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698