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

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: 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
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..e4c2dc5dc59189c9b2bdb0c345f234b5e4668561
--- /dev/null
+++ b/ui/message_center/views/notification_progress_bar.h
@@ -0,0 +1,41 @@
+// 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/slide_animation.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/message_center/message_center_export.h"
+#include "ui/views/controls/progress_bar.h"
+
+namespace message_center {
+
+class MESSAGE_CENTER_EXPORT NotificationProgressBar
+ : public views::ProgressBar, public gfx::AnimationDelegate {
+ public:
+ NotificationProgressBar();
+ ~NotificationProgressBar() override;
+
+ void SetIndeterminate(bool is_indeteminate);
+
+ private:
+ // Overriden from views::ProgressBar (originally from views::View)
+ gfx::Size GetPreferredSize() const override;
+ 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(NotificationProgressBar);
+};
+
+} // namespace message_center
+
+#endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_PROGRESS_BAR_H_

Powered by Google App Engine
This is Rietveld 408576698