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

Side by Side Diff: ui/message_center/views/notification_progress_bar.h

Issue 1447933002: Implement an indeterminate progress-bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split into two class Created 5 years 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
OLDNEW
(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/slide_animation.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/message_center/message_center_export.h"
13 #include "ui/views/controls/progress_bar.h"
14
15 namespace message_center {
16
17 class NotificationProgressBarBase : public views::ProgressBar {
18 private:
19 // Overriden from views::ProgressBar (originally from views::View)
20 gfx::Size GetPreferredSize() const override;
21 };
22
23 class MESSAGE_CENTER_EXPORT NotificationProgressBar
24 : public NotificationProgressBarBase {
25 public:
26 NotificationProgressBar();
27 ~NotificationProgressBar() override;
28
29 void SetIndeterminate(bool is_indeteminate);
Jun Mukai 2015/11/24 17:51:11 SetIntermediate wouldn't be necessary, it won't ch
yoshiki 2015/11/25 15:14:28 I missed to remove this. Removed.
30
31 private:
32 // Overriden from views::ProgressBar (originally from views::View)
33 void OnPaint(gfx::Canvas* canvas) override;
34
35 DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar);
36 };
37
38 class MESSAGE_CENTER_EXPORT NotificationIndeterminateProgressBar
39 : public NotificationProgressBarBase, public gfx::AnimationDelegate {
40 public:
41 NotificationIndeterminateProgressBar();
42 ~NotificationIndeterminateProgressBar() override;
43
44 private:
45 // Overriden from views::ProgressBar (originally from views::View)
46 void OnPaint(gfx::Canvas* canvas) override;
47
48 // Overriden from gfx::AnimationDelegate
49 void AnimationProgressed(const gfx::Animation* animation) override;
50 void AnimationEnded(const gfx::Animation* animation) override;
51
52 scoped_ptr<gfx::LinearAnimation> indeterminate_bar_animation_;
53
54 DISALLOW_COPY_AND_ASSIGN(NotificationIndeterminateProgressBar);
55 };
56
57 } // namespace message_center
58
59 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698