| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_CONTROLS_PROGRESS_BAR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_PROGRESS_BAR_H_ |
| 6 #define UI_VIEWS_CONTROLS_PROGRESS_BAR_H_ | 6 #define UI_VIEWS_CONTROLS_PROGRESS_BAR_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
| 11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class LinearAnimation; | 14 class LinearAnimation; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 | 18 |
| 19 // Progress bar is a control that indicates progress visually. | 19 // Progress bar is a control that indicates progress visually. |
| 20 class VIEWS_EXPORT ProgressBar : public View, public gfx::AnimationDelegate { | 20 class VIEWS_EXPORT ProgressBar : public View, public gfx::AnimationDelegate { |
| 21 public: | 21 public: |
| 22 // The preferred height parameter makes it easier to use a ProgressBar with | 22 // The preferred height parameter makes it easier to use a ProgressBar with |
| 23 // layout managers that size to preferred size. | 23 // layout managers that size to preferred size. |
| 24 explicit ProgressBar(int preferred_height = 5); | 24 explicit ProgressBar(int preferred_height = 5); |
| 25 ~ProgressBar() override; | 25 ~ProgressBar() override; |
| 26 | 26 |
| 27 // Overridden from View: | 27 // Overridden from View: |
| 28 void GetAccessibleState(ui::AXViewState* state) override; | 28 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 29 gfx::Size GetPreferredSize() const override; | 29 gfx::Size GetPreferredSize() const override; |
| 30 const char* GetClassName() const override; | 30 const char* GetClassName() const override; |
| 31 void OnPaint(gfx::Canvas* canvas) override; | 31 void OnPaint(gfx::Canvas* canvas) override; |
| 32 | 32 |
| 33 double current_value() const { return current_value_; } | 33 double current_value() const { return current_value_; } |
| 34 | 34 |
| 35 // Sets the current value. Values outside of the display range of 0.0-1.0 will | 35 // Sets the current value. Values outside of the display range of 0.0-1.0 will |
| 36 // be displayed with an infinite loading animation. | 36 // be displayed with an infinite loading animation. |
| 37 void SetValue(double value); | 37 void SetValue(double value); |
| 38 | 38 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 const int preferred_height_; | 61 const int preferred_height_; |
| 62 | 62 |
| 63 std::unique_ptr<gfx::LinearAnimation> indeterminate_bar_animation_; | 63 std::unique_ptr<gfx::LinearAnimation> indeterminate_bar_animation_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(ProgressBar); | 65 DISALLOW_COPY_AND_ASSIGN(ProgressBar); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace views | 68 } // namespace views |
| 69 | 69 |
| 70 #endif // UI_VIEWS_CONTROLS_PROGRESS_BAR_H_ | 70 #endif // UI_VIEWS_CONTROLS_PROGRESS_BAR_H_ |
| OLD | NEW |