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

Unified Diff: ash/system/tray/tray_views.h

Issue 12180027: Add spinner UI to show bluetooth is discovering devices. (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/tray/tray_views.h
diff --git a/ash/system/tray/tray_views.h b/ash/system/tray/tray_views.h
index 4e7588dda1cb85d2a99dd8c31b2ecb8a83417b9a..261c254177b158854d5a3ddb3c82d0df7c5bf090 100644
--- a/ash/system/tray/tray_views.h
+++ b/ash/system/tray/tray_views.h
@@ -26,6 +26,7 @@ class ImageSkia;
namespace views {
class Label;
+class SmoothedThrobber;
}
namespace ash {
@@ -271,6 +272,34 @@ class TrayBarButtonWithTitle : public views::CustomButton {
DISALLOW_COPY_AND_ASSIGN(TrayBarButtonWithTitle);
};
+// A throbber with tooltip and animation for starting/stopping.
+class ThrobberView : public views::View {
+ public:
+ ThrobberView();
+ virtual ~ThrobberView();
+
+ // Overriden from views::View.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
sadrul 2013/02/05 02:31:42 Overrides usually go after the non-overrides.
jennyz 2013/02/05 17:37:20 Done.
+ virtual void Layout() OVERRIDE;
+ virtual bool GetTooltipText(
+ const gfx::Point& p, string16* tooltip) const OVERRIDE;
+
+ void Start();
+ void Stop();
+ void SetTooltipText(const string16& tooltip_text);
+
+ private:
+ // Schedules animation for starting/stopping throbber.
+ void ScheduleAnimation(bool start_throbber);
+
+ views::SmoothedThrobber* throbber_;
+
+ // The current tooltip text.
+ string16 tooltip_text_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThrobberView);
+};
+
// The 'special' looking row in the uber-tray popups. This is usually the bottom
// row in the popups, and has a fixed height.
class SpecialPopupRow : public views::View {
@@ -282,6 +311,7 @@ class SpecialPopupRow : public views::View {
void SetContent(views::View* view);
void AddButton(TrayPopupHeaderButton* button);
+ void AddThrobber(ThrobberView* throbber);
views::View* content() const { return content_; }

Powered by Google App Engine
This is Rietveld 408576698