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

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: 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..956c8bc40f83908e9c3d9746eca99bc20b055b39 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 (!device.paired || device.connecting)
+ return '';
+ return this.i18n(
+ device.connected ? 'bluetoothConnected' : 'bluetoothNotConnected');
+ },
+
+ /**
+ * @param {!chrome.bluetooth.Device} device
+ * @return {boolean} True if connection status should be shown as the
+ * secandary text of the |device| in device list.
stevenjb 2017/01/18 18:06:17 secondary
fukino 2017/01/19 01:06:17 Done.
+ * @private
+ */
+ hasConnectionStatusText_: function(device) {
+ return this.getConnectionStatusText_(device) != '';
stevenjb 2017/01/18 18:06:17 nit: Put the logic here and call this from getConn
fukino 2017/01/19 01:06:17 Done.
+ },
+
+ /**
+ * @param {!chrome.bluetooth.Device} device
* @return {boolean}
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698