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

Unified 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: Fix test failure Created 5 years, 1 month 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 | « ui/message_center/message_center.gyp ('k') | ui/message_center/views/notification_progress_bar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_progress_bar.h
diff --git a/ui/message_center/views/notification_progress_bar.h b/ui/message_center/views/notification_progress_bar.h
new file mode 100644
index 0000000000000000000000000000000000000000..4cec16271b23a72e77ccbabf0437710b7bcfdbae
--- /dev/null
+++ b/ui/message_center/views/notification_progress_bar.h
@@ -0,0 +1,64 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_
+#define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_
+
+#include "base/macros.h"
+#include "ui/gfx/animation/animation_delegate.h"
+#include "ui/gfx/animation/linear_animation.h"
+#include "ui/message_center/message_center_export.h"
+#include "ui/views/controls/progress_bar.h"
+
+namespace message_center {
+
+class MESSAGE_CENTER_EXPORT NotificationProgressBarBase
+ : public views::ProgressBar {
+ public:
+ virtual bool is_indeterminate() = 0;
+
+ private:
+ // Overriden from views::ProgressBar (originally from views::View)
+ gfx::Size GetPreferredSize() const override;
+};
+
+class MESSAGE_CENTER_EXPORT NotificationProgressBar
+ : public NotificationProgressBarBase {
+ public:
+ NotificationProgressBar();
+ ~NotificationProgressBar() override;
+
+ bool is_indeterminate() override;
+
+ private:
+ // Overriden from views::ProgressBar (originally from views::View)
+ void OnPaint(gfx::Canvas* canvas) override;
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar);
+};
+
+class MESSAGE_CENTER_EXPORT NotificationIndeterminateProgressBar
+ : public NotificationProgressBarBase, public gfx::AnimationDelegate {
+ public:
+ NotificationIndeterminateProgressBar();
+ ~NotificationIndeterminateProgressBar() override;
+
+ bool is_indeterminate() override;
+
+ private:
+ // Overriden from views::ProgressBar (originally from views::View)
+ void OnPaint(gfx::Canvas* canvas) override;
+
+ // Overriden from gfx::AnimationDelegate
+ void AnimationProgressed(const gfx::Animation* animation) override;
+ void AnimationEnded(const gfx::Animation* animation) override;
+
+ scoped_ptr<gfx::LinearAnimation> indeterminate_bar_animation_;
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationIndeterminateProgressBar);
+};
+
+} // namespace message_center
+
+#endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_
« no previous file with comments | « ui/message_center/message_center.gyp ('k') | ui/message_center/views/notification_progress_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698