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

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

Issue 12180027: Add spinner UI to show bluetooth is discovering devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a subclass of SmoothedThrobber and override GetTooltipText to show tooltip on throbber. 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
« no previous file with comments | « no previous file | ash/system/tray/tray_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/bluetooth/tray_bluetooth.cc
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc
index 021eea47e02d840b95b13790149c7986d6864e27..842a7be143dd0932d169f225f77c6af655ceb3fc 100644
--- a/ash/system/bluetooth/tray_bluetooth.cc
+++ b/ash/system/bluetooth/tray_bluetooth.cc
@@ -103,8 +103,12 @@ class BluetoothDetailedView : public TrayDetailsView,
ash::SystemTrayDelegate* delegate =
ash::Shell::GetInstance()->system_tray_delegate();
bool bluetooth_enabled = delegate->GetBluetoothEnabled();
- if (!bluetooth_discovering_ && bluetooth_enabled)
+ if (!bluetooth_discovering_ && bluetooth_enabled) {
delegate->BluetoothStartDiscovering();
+ throbber_->Start();
+ } else if(!bluetooth_enabled) {
+ throbber_->Stop();
+ }
bluetooth_discovering_ = bluetooth_enabled;
}
@@ -114,6 +118,7 @@ class BluetoothDetailedView : public TrayDetailsView,
if (bluetooth_discovering_) {
bluetooth_discovering_ = false;
delegate->BluetoothStopDiscovering();
+ throbber_->Stop();
}
}
@@ -140,6 +145,11 @@ class BluetoothDetailedView : public TrayDetailsView,
if (login_ == user::LOGGED_IN_LOCKED)
return;
+ throbber_ = new ThrobberView;
+ throbber_->SetTooltipText(
+ l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING));
+ footer()->AddThrobber(throbber_);
+
// Do not allow toggling bluetooth in the lock screen.
ash::SystemTrayDelegate* delegate =
ash::Shell::GetInstance()->system_tray_delegate();
@@ -322,6 +332,7 @@ class BluetoothDetailedView : public TrayDetailsView,
std::map<views::View*, std::string> device_map_;
views::View* add_device_;
+ ThrobberView* throbber_;
TrayPopupHeaderButton* toggle_bluetooth_;
HoverHighlightView* enable_bluetooth_;
BluetoothDeviceList connected_devices_;
« no previous file with comments | « no previous file | ash/system/tray/tray_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698