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

Unified Diff: views/controls/progress_bar.cc

Issue 8429014: views: Move the overridden methods of ProgressBar to private section. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 9 years, 2 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 | « views/controls/progress_bar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/progress_bar.cc
diff --git a/views/controls/progress_bar.cc b/views/controls/progress_bar.cc
index 587e6dc435efdb15d459f841df380bb4f31823e9..41c69ec4c959a0847d537dda81023c03137a3830 100644
--- a/views/controls/progress_bar.cc
+++ b/views/controls/progress_bar.cc
@@ -21,9 +21,6 @@
#include "views/border.h"
#include "views/painter.h"
-using std::max;
-using std::min;
-
namespace {
// Corner radius for the progress bar's border.
@@ -143,12 +140,34 @@ ProgressBar::ProgressBar()
ProgressBar::~ProgressBar() {
}
-gfx::Size ProgressBar::GetPreferredSize() {
- return gfx::Size(100, 16);
+void ProgressBar::SetDisplayRange(double min_display_value,
+ double max_display_value) {
+ if (min_display_value != min_display_value_ ||
+ max_display_value != max_display_value_) {
+ DCHECK(min_display_value < max_display_value);
+ min_display_value_ = min_display_value;
+ max_display_value_ = max_display_value;
+ SchedulePaint();
+ }
}
-std::string ProgressBar::GetClassName() const {
- return kViewClassName;
+void ProgressBar::SetValue(double value) {
+ if (value != current_value_) {
+ current_value_ = value;
+ SchedulePaint();
+ }
+}
+
+void ProgressBar::SetTooltipText(const string16& tooltip_text) {
+ tooltip_text_ = tooltip_text;
+}
+
+bool ProgressBar::GetTooltipText(const gfx::Point& p, string16* tooltip) const {
+ DCHECK(tooltip);
+ if (tooltip == NULL)
+ return false;
+ tooltip->assign(tooltip_text_);
+ return !tooltip_text_.empty();
}
void ProgressBar::GetAccessibleState(ui::AccessibleViewState* state) {
@@ -156,9 +175,17 @@ void ProgressBar::GetAccessibleState(ui::AccessibleViewState* state) {
state->state = ui::AccessibilityTypes::STATE_READONLY;
}
+gfx::Size ProgressBar::GetPreferredSize() {
+ return gfx::Size(100, 16);
+}
+
+std::string ProgressBar::GetClassName() const {
+ return kViewClassName;
+}
+
void ProgressBar::OnPaint(gfx::Canvas* canvas) {
- const double capped_value =
- min(max(current_value_, min_display_value_), max_display_value_);
+ const double capped_value = std::min(
+ std::max(current_value_, min_display_value_), max_display_value_);
const double capped_fraction =
(capped_value - min_display_value_) /
(max_display_value_ - min_display_value_);
@@ -289,34 +316,4 @@ void ProgressBar::OnPaint(gfx::Canvas* canvas) {
#endif
}
-bool ProgressBar::GetTooltipText(const gfx::Point& p, string16* tooltip) const {
- DCHECK(tooltip);
- if (tooltip == NULL)
- return false;
- tooltip->assign(tooltip_text_);
- return !tooltip_text_.empty();
-}
-
-void ProgressBar::SetDisplayRange(double min_display_value,
- double max_display_value) {
- if (min_display_value != min_display_value_ ||
- max_display_value != max_display_value_) {
- DCHECK(min_display_value < max_display_value);
- min_display_value_ = min_display_value;
- max_display_value_ = max_display_value;
- SchedulePaint();
- }
-}
-
-void ProgressBar::SetValue(double value) {
- if (value != current_value_) {
- current_value_ = value;
- SchedulePaint();
- }
-}
-
-void ProgressBar::SetTooltipText(const string16& tooltip_text) {
- tooltip_text_ = tooltip_text;
-}
-
} // namespace views
« no previous file with comments | « views/controls/progress_bar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698