OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_ | |
6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "ui/gfx/animation/animation_delegate.h" | |
10 #include "ui/gfx/animation/linear_animation.h" | |
11 #include "ui/message_center/message_center_export.h" | |
12 #include "ui/views/controls/progress_bar.h" | |
13 | |
14 namespace message_center { | |
15 | |
16 class MESSAGE_CENTER_EXPORT NotificationProgressBarBase | |
17 : public views::ProgressBar { | |
18 public: | |
19 virtual bool is_indeterminate() = 0; | |
20 | |
21 private: | |
22 // Overriden from views::ProgressBar (originally from views::View) | |
23 gfx::Size GetPreferredSize() const override; | |
24 }; | |
25 | |
26 class MESSAGE_CENTER_EXPORT NotificationProgressBar | |
27 : public NotificationProgressBarBase { | |
28 public: | |
29 NotificationProgressBar(); | |
30 ~NotificationProgressBar() override; | |
31 | |
32 bool is_indeterminate() override; | |
33 | |
34 private: | |
35 // Overriden from views::ProgressBar (originally from views::View) | |
36 void OnPaint(gfx::Canvas* canvas) override; | |
37 | |
38 DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar); | |
39 }; | |
40 | |
41 class MESSAGE_CENTER_EXPORT NotificationIndeterminateProgressBar | |
42 : public NotificationProgressBarBase, public gfx::AnimationDelegate { | |
43 public: | |
44 NotificationIndeterminateProgressBar(); | |
45 ~NotificationIndeterminateProgressBar() override; | |
46 | |
47 bool is_indeterminate() override; | |
48 | |
49 private: | |
50 // Overriden from views::ProgressBar (originally from views::View) | |
51 void OnPaint(gfx::Canvas* canvas) override; | |
52 | |
53 // Overriden from gfx::AnimationDelegate | |
54 void AnimationProgressed(const gfx::Animation* animation) override; | |
55 void AnimationEnded(const gfx::Animation* animation) override; | |
56 | |
57 std::unique_ptr<gfx::LinearAnimation> indeterminate_bar_animation_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(NotificationIndeterminateProgressBar); | |
60 }; | |
61 | |
62 } // namespace message_center | |
63 | |
64 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_ | |
OLD | NEW |