1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_TRAY_THROBBER_VIEW_H_
6 #define ASH_SYSTEM_TRAY_THROBBER_VIEW_H_
8 #include "ui/gfx/size.h"
9 #include "ui/views/controls/throbber.h"
10 #include "ui/views/view.h"
14 // A SmoothedThrobber with tooltip.
15 class SystemTrayThrobber
: public views::SmoothedThrobber
{
17 SystemTrayThrobber(int frame_delay_ms
);
18 virtual ~SystemTrayThrobber();
20 void SetTooltipText(const base::string16
& tooltip_text
);
22 // Overriden from views::View.
23 virtual bool GetTooltipText(
24 const gfx::Point
& p
, base::string16
* tooltip
) const OVERRIDE
;
27 // The current tooltip text.
28 base::string16 tooltip_text_
;
30 DISALLOW_COPY_AND_ASSIGN(SystemTrayThrobber
);
33 // A View containing a SystemTrayThrobber with animation for starting/stopping.
34 class ThrobberView
: public views::View
{
37 virtual ~ThrobberView();
41 void SetTooltipText(const base::string16
& tooltip_text
);
43 // Overriden from views::View.
44 virtual gfx::Size
GetPreferredSize() const OVERRIDE
;
45 virtual void Layout() OVERRIDE
;
46 virtual bool GetTooltipText(
47 const gfx::Point
& p
, base::string16
* tooltip
) const OVERRIDE
;
50 // Schedules animation for starting/stopping throbber.
51 void ScheduleAnimation(bool start_throbber
);
53 SystemTrayThrobber
* throbber_
;
55 // The current tooltip text.
56 base::string16 tooltip_text_
;
58 DISALLOW_COPY_AND_ASSIGN(ThrobberView
);
63 #endif // ASH_SYSTEM_TRAY_THROBBER_VIEW_H_