| Index: views/controls/progress_bar.h
|
| diff --git a/views/controls/progress_bar.h b/views/controls/progress_bar.h
|
| index 61c050fbf9017b6d769f5f0ddb2c69c59998db4a..5156c8f8236bd4e233899fbfce9ac6eaaacc0e2c 100644
|
| --- a/views/controls/progress_bar.h
|
| +++ b/views/controls/progress_bar.h
|
| @@ -28,52 +28,48 @@ namespace views {
|
|
|
| class VIEWS_EXPORT ProgressBar : public View {
|
| public:
|
| + // The value range defaults to [0.0, 1.0].
|
| ProgressBar();
|
| virtual ~ProgressBar();
|
|
|
| - // Overridden to return preferred size of the progress bar.
|
| - virtual gfx::Size GetPreferredSize();
|
| + double current_value() const { return current_value_; }
|
|
|
| - // Returns views/ProgressBar.
|
| - virtual std::string GetClassName() const;
|
| + // View implementation.
|
| + virtual gfx::Size GetPreferredSize() OVERRIDE;
|
| + virtual std::string GetClassName() const OVERRIDE;
|
| + virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
|
| + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
|
| + virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip)
|
| + OVERRIDE;
|
|
|
| - // Overridden to paint
|
| - virtual void OnPaint(gfx::Canvas* canvas);
|
| + // Sets the inclusive range of values to be displayed. Values outside of the
|
| + // range will be capped when displayed.
|
| + virtual void SetDisplayRange(double min_display_value,
|
| + double max_display_value);
|
|
|
| - // Set and get the progress bar progress in range [0, kMaxProgress].
|
| - virtual void SetProgress(int progress);
|
| - virtual int GetProgress() const;
|
| - // Add progress to current.
|
| - virtual void AddProgress(int tick);
|
| + // Sets the current value. Values outside of the range [min_display_value_,
|
| + // max_display_value_] will be stored unmodified and capped for display.
|
| + virtual void SetValue(double value);
|
|
|
| - // 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.
|
| - // To revert to default behavior, call this with an empty string.
|
| + // 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. To
|
| + // revert to default behavior, call this with an empty string.
|
| virtual void SetTooltipText(const std::wstring& tooltip_text);
|
|
|
| - // Gets the tooltip text if has been specified with SetTooltipText().
|
| - virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip)
|
| - OVERRIDE;
|
| -
|
| - // Sets the enabled state.
|
| - virtual void OnEnabledChanged() OVERRIDE;
|
|
|
| - // Accessibility accessors, overridden from View.
|
| - virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
|
| + private:
|
| + static const char kViewClassName[];
|
|
|
| - // Maximum value of progress.
|
| - static const int kMaxProgress;
|
| + // Inclusive range used when displaying values.
|
| + double min_display_value_;
|
| + double max_display_value_;
|
|
|
| - private:
|
| - // Progress in range [0, kMaxProgress].
|
| - int progress_;
|
| + // Current value. May be outside of [min_display_value_, max_display_value_].
|
| + double current_value_;
|
|
|
| // Tooltip text.
|
| string16 tooltip_text_;
|
|
|
| - // The view class name.
|
| - static const char kViewClassName[];
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(ProgressBar);
|
| };
|
|
|
|
|