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

Unified Diff: views/controls/progress_bar.h

Issue 7646004: chromeos: Improve brightness and volume animations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hopefully fix windows compile and DCHECK Created 9 years, 4 months 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
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble_view.cc ('k') | views/controls/progress_bar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble_view.cc ('k') | views/controls/progress_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698