Chromium Code Reviews| Index: ash/system/bluetooth/tray_bluetooth.cc |
| diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc |
| index b12f0b2f2983cda90b85194018be5721b8f2d94b..4799f42bd607fca71303caea7ac95480c9e6ad9b 100644 |
| --- a/ash/system/bluetooth/tray_bluetooth.cc |
| +++ b/ash/system/bluetooth/tray_bluetooth.cc |
| @@ -125,6 +125,7 @@ class BluetoothDetailedView : public TrayDetailsView, |
| void UpdateBlueToothDeviceList() { |
| connected_devices_.clear(); |
| + connecting_devices_.clear(); |
| paired_not_connected_devices_.clear(); |
| discovered_not_paired_devices_.clear(); |
| BluetoothDeviceList list; |
| @@ -133,6 +134,8 @@ class BluetoothDetailedView : public TrayDetailsView, |
| for (size_t i = 0; i < list.size(); ++i) { |
| if (list[i].connected) |
| connected_devices_.push_back(list[i]); |
| + else if (list[i].connecting) |
|
deymo
2013/03/02 02:31:13
If the property IsConnecting() is true the device
Jun Mukai
2013/04/09 03:15:08
Done.
|
| + connecting_devices_.push_back(list[i]); |
| else if (list[i].paired) |
| paired_not_connected_devices_.push_back(list[i]); |
| else if (list[i].visible) |
| @@ -196,6 +199,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(); |
| @@ -221,8 +226,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); |
| + } |
| HoverHighlightView* container = AddScrollListItem( |
| - list[i].display_name, |
| + display_name, |
| bold? gfx::Font::BOLD : gfx::Font::NORMAL, |
| checked, enabled); |
| device_map_[container] = list[i].address; |
| @@ -278,7 +288,8 @@ class BluetoothDetailedView : public TrayDetailsView, |
| // or disconnected if such an operation is going to be performed underway. |
| void UpdateClickedDevice(std::string device_id, views::View* item_container) { |
| string16 display_name; |
| - if (FoundDevice(device_id, connected_devices_, &display_name)) { |
| + if (FoundDevice(device_id, connected_devices_, &display_name) || |
| + FoundDevice(device_id, connecting_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_, |
| @@ -337,6 +348,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_; |