Chromium Code Reviews| 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..ddeb48779e06bc394e9f9808394276b9cca1edb7 |
| --- /dev/null |
| +++ b/ui/message_center/views/notification_progress_bar.h |
| @@ -0,0 +1,59 @@ |
| +// 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 NotificationProgressBarBase : public views::ProgressBar { |
| + 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; |
| + |
| + 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.
|
| + |
| + 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; |
| + |
| + 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_ |