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

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: 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 | « ash/system/bluetooth/tray_bluetooth.cc ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6db419caaa1650c1a842e7d2b550181e8000b877 100644
--- a/ash/system/tray/tray_views.h
+++ b/ash/system/tray/tray_views.h
@@ -16,6 +16,7 @@
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/slider.h"
+#include "ui/views/controls/throbber.h"
#include "ui/views/view.h"
typedef unsigned int SkColor;
@@ -271,6 +272,53 @@ class TrayBarButtonWithTitle : public views::CustomButton {
DISALLOW_COPY_AND_ASSIGN(TrayBarButtonWithTitle);
};
+// A SmoothedThrobber with tooltip.
+class SystemTrayThrobber : public views::SmoothedThrobber {
+ public:
+ SystemTrayThrobber(int frame_delay_ms);
+ virtual ~SystemTrayThrobber();
+
+ void SetTooltipText(const string16& tooltip_text);
+
+ // Overriden from views::View.
+ virtual bool GetTooltipText(
+ const gfx::Point& p, string16* tooltip) const OVERRIDE;
+
+ private:
+ // The current tooltip text.
+ string16 tooltip_text_;
+
+ DISALLOW_COPY_AND_ASSIGN(SystemTrayThrobber);
+};
+
+// A View containing a SystemTrayThrobber with animation for starting/stopping.
+class ThrobberView : public views::View {
+ public:
+ ThrobberView();
+ virtual ~ThrobberView();
+
+ void Start();
+ void Stop();
+ void SetTooltipText(const string16& tooltip_text);
+
+ // Overriden from views::View.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual void Layout() OVERRIDE;
+ virtual bool GetTooltipText(
+ const gfx::Point& p, string16* tooltip) const OVERRIDE;
+
+ private:
+ // Schedules animation for starting/stopping throbber.
+ void ScheduleAnimation(bool start_throbber);
+
+ SystemTrayThrobber* 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 +330,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_; }
« no previous file with comments | « ash/system/bluetooth/tray_bluetooth.cc ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698