Index: ash/system/bluetooth/tray_bluetooth.cc |
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc |
index 6b035f0b7148f01138dccf69b8a2942bf554a649..c83a2b85c786e4cc82ed079c3484be8fa9b38537 100644 |
--- a/ash/system/bluetooth/tray_bluetooth.cc |
+++ b/ash/system/bluetooth/tray_bluetooth.cc |
@@ -128,13 +128,16 @@ class BluetoothDetailedView : public TrayDetailsView, |
void UpdateBlueToothDeviceList() { |
connected_devices_.clear(); |
+ connecting_devices_.clear(); |
paired_not_connected_devices_.clear(); |
discovered_not_paired_devices_.clear(); |
BluetoothDeviceList list; |
Shell::GetInstance()->system_tray_delegate()-> |
GetAvailableBluetoothDevices(&list); |
for (size_t i = 0; i < list.size(); ++i) { |
- if (list[i].connected) |
+ if (list[i].connecting) |
+ connecting_devices_.push_back(list[i]); |
+ else if (list[i].connected) |
connected_devices_.push_back(list[i]); |
else if (list[i].paired) |
paired_not_connected_devices_.push_back(list[i]); |
@@ -199,6 +202,8 @@ class BluetoothDetailedView : public TrayDetailsView, |
AppendSameTypeDevicesToScrollList( |
connected_devices_, true, true, bluetooth_enabled); |
AppendSameTypeDevicesToScrollList( |
+ connecting_devices_, true, false, bluetooth_enabled); |
+ AppendSameTypeDevicesToScrollList( |
paired_not_connected_devices_, false, false, bluetooth_enabled); |
if (discovered_not_paired_devices_.size() > 0) |
AddScrollSeparator(); |
@@ -224,8 +229,13 @@ class BluetoothDetailedView : public TrayDetailsView, |
bool checked, |
bool enabled) { |
for (size_t i = 0; i < list.size(); ++i) { |
+ string16 display_name = list[i].display_name; |
+ if (list[i].connecting) { |
+ display_name = l10n_util::GetStringFUTF16( |
+ IDS_ASH_STATUS_TRAY_BLUETOOTH_CONNECTING, display_name); |
+ } |
jennyz
2013/04/10 16:15:37
It's a little bit unclean to modify the display na
Jun Mukai
2013/04/13 00:05:35
Done.
|
HoverHighlightView* container = AddScrollListItem( |
- list[i].display_name, |
+ display_name, |
bold? gfx::Font::BOLD : gfx::Font::NORMAL, |
checked, enabled); |
device_map_[container] = list[i].address; |
@@ -284,7 +294,8 @@ class BluetoothDetailedView : public TrayDetailsView, |
if (FoundDevice(device_id, connected_devices_, &display_name)) { |
display_name = l10n_util::GetStringFUTF16( |
IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCONNECTING, display_name); |
- } else if (FoundDevice(device_id, paired_not_connected_devices_, |
+ } else if (FoundDevice(device_id, connecting_devices_, &display_name) || |
Jun Mukai
2013/04/13 00:05:35
noticed this is not necessary. since connecting_de
|
+ FoundDevice(device_id, paired_not_connected_devices_, |
&display_name)) { |
display_name = l10n_util::GetStringFUTF16( |
IDS_ASH_STATUS_TRAY_BLUETOOTH_CONNECTING, display_name); |
@@ -340,6 +351,7 @@ class BluetoothDetailedView : public TrayDetailsView, |
TrayPopupHeaderButton* toggle_bluetooth_; |
HoverHighlightView* enable_bluetooth_; |
BluetoothDeviceList connected_devices_; |
+ BluetoothDeviceList connecting_devices_; |
BluetoothDeviceList paired_not_connected_devices_; |
BluetoothDeviceList discovered_not_paired_devices_; |
bool bluetooth_discovering_; |