diff options
author | avayvod@google.com <avayvod@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 12:39:13 +0000 |
---|---|---|
committer | avayvod@google.com <avayvod@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 12:39:13 +0000 |
commit | 857e79dae449847fe9045034039e57b1433ddb38 (patch) | |
tree | b6be69ac644126f33ab5f32933ef720929ff6409 /views/controls/progress_bar.h | |
parent | 6a6ce8b3a868dd1f94f8731ebd05abd39da46fec (diff) | |
download | chromium_src-857e79dae449847fe9045034039e57b1433ddb38.zip chromium_src-857e79dae449847fe9045034039e57b1433ddb38.tar.gz chromium_src-857e79dae449847fe9045034039e57b1433ddb38.tar.bz2 |
Switched progress bar to integral positions (from 0 to 100).
BUG=none
TEST=Launch with --login-manager --login-screen=update and verify that
progress bar shows increasing progress and login screen is shown at the
end.
Review URL: http://codereview.chromium.org/945003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/progress_bar.h')
-rw-r--r-- | views/controls/progress_bar.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/views/controls/progress_bar.h b/views/controls/progress_bar.h index e5587d5..128941f 100644 --- a/views/controls/progress_bar.h +++ b/views/controls/progress_bar.h @@ -5,6 +5,8 @@ #ifndef VIEWS_CONTROLS_PROGRESS_BAR_H_ #define VIEWS_CONTROLS_PROGRESS_BAR_H_ +#include <string> + #include "views/view.h" namespace gfx { @@ -25,12 +27,7 @@ namespace views { class ProgressBar : public View { public: - // Creates a new progress bar with progress zero. ProgressBar(); - - // Creates a new progress bar with specified progress. - explicit ProgressBar(double progress); - virtual ~ProgressBar(); // Overridden to return preferred size of the progress bar. @@ -42,9 +39,9 @@ class ProgressBar : public View { // Overridden to paint virtual void Paint(gfx::Canvas* canvas); - // Set and get the progress bar progress in range [0, 1]. - virtual void SetProgress(double progress); - virtual double GetProgress() const; + // Set and get the progress bar progress in range [0, kMaxProgress]. + virtual void SetProgress(int progress); + virtual int GetProgress() const; // Sets the tooltip text. Default behavior for a progress bar is to show // no tooltip on mouse hover. Calling this lets you set a custom tooltip. @@ -62,11 +59,12 @@ class ProgressBar : public View { virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleState(AccessibilityTypes::State* state); - private: - void Init(double progress); + // Maximum value of progress. + static const int kMaxProgress; - // Progress in range [0, 1]. - double progress_; + private: + // Progress in range [0, kMaxProgress]. + int progress_; // Tooltip text. std::wstring tooltip_text_; |