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

Side by Side Diff: ash/common/system/tray/throbber_view.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ash/common/system/tray/system_tray_unittest.cc ('k') | ash/common/system/tray/throbber_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef ASH_COMMON_SYSTEM_TRAY_THROBBER_VIEW_H_
6 #define ASH_COMMON_SYSTEM_TRAY_THROBBER_VIEW_H_
7
8 #include "base/macros.h"
9 #include "ui/gfx/geometry/size.h"
10 #include "ui/views/controls/throbber.h"
11 #include "ui/views/view.h"
12
13 namespace ash {
14
15 // A SmoothedThrobber with tooltip.
16 class SystemTrayThrobber : public views::SmoothedThrobber {
17 public:
18 SystemTrayThrobber();
19 ~SystemTrayThrobber() override;
20
21 void SetTooltipText(const base::string16& tooltip_text);
22
23 // Overriden from views::View.
24 bool GetTooltipText(const gfx::Point& p,
25 base::string16* tooltip) const override;
26
27 private:
28 // The current tooltip text.
29 base::string16 tooltip_text_;
30
31 DISALLOW_COPY_AND_ASSIGN(SystemTrayThrobber);
32 };
33
34 // A View containing a SystemTrayThrobber with animation for starting/stopping.
35 class ThrobberView : public views::View {
36 public:
37 ThrobberView();
38 ~ThrobberView() override;
39
40 void Start();
41 void Stop();
42 void SetTooltipText(const base::string16& tooltip_text);
43
44 // Overriden from views::View.
45 gfx::Size GetPreferredSize() const override;
46 void Layout() override;
47 bool GetTooltipText(const gfx::Point& p,
48 base::string16* tooltip) const override;
49
50 private:
51 // Schedules animation for starting/stopping throbber.
52 void ScheduleAnimation(bool start_throbber);
53
54 SystemTrayThrobber* throbber_;
55
56 // The current tooltip text.
57 base::string16 tooltip_text_;
58
59 DISALLOW_COPY_AND_ASSIGN(ThrobberView);
60 };
61
62 } // namespace ash
63
64 #endif // ASH_COMMON_SYSTEM_TRAY_THROBBER_VIEW_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_unittest.cc ('k') | ash/common/system/tray/throbber_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698