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

Unified Diff: ash/system/bluetooth/tray_bluetooth.cc

Issue 12385064: Introduce 'connecting' field to bluetooth device info for system tray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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: 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_;
« no previous file with comments | « no previous file | ash/system/tray/system_tray_delegate.h » ('j') | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698