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

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

Issue 2637053002: MD Settings: Add Bluetooth device type icons in device lists. (Closed)
Patch Set: Fix an annotation. 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 876f1635714a75a4ffd6c8280a60992f6876fcf9..8816fd12e8d9d027cd027f3e9c6523b901d75598 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
@@ -77,4 +77,40 @@ Polymer({
isDisconnected_: function(device) {
return !device.connected && !device.connecting;
},
+
+ /**
+ * Returns device type icon's ID corresponding to the given device.
+ * To be consistent with the Bluetooth device list in system menu, this
+ * mapping needs to be synced with ash::tray::GetBluetoothDeviceIcon().
+ *
+ * @param {!chrome.bluetooth.Device} device
+ * @return {string}
+ * @private
+ */
+ getDeviceIcon_: function(device) {
+ switch (device.type) {
+ case 'computer':
+ return 'settings:computer';
+ case 'phone':
+ return 'settings:smartphone';
+ case 'audio':
+ case 'carAudio':
+ return 'settings:headset';
+ case 'video':
+ return 'settings:videocam';
+ case 'joystick':
+ case 'gamepad':
+ return 'settings:gamepad';
+ case 'keyboard':
+ case 'keyboardMouseCombo':
+ return 'settings:keyboard';
+ case 'tablet':
+ return 'settings:tablet';
+ case 'mouse':
+ return 'settings:mouse';
+ default:
+ return device.connected ?
+ 'settings:bluetooth-connected' : 'settings:bluetooth';
+ }
+ },
});

Powered by Google App Engine
This is Rietveld 408576698