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

Unified Diff: ui/views/examples/progress_bar_example.cc

Issue 14367021: Rename ClampToMin and ClampToMax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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 | « ui/views/controls/tabbed_pane/tabbed_pane.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/progress_bar_example.cc
diff --git a/ui/views/examples/progress_bar_example.cc b/ui/views/examples/progress_bar_example.cc
index b2f03bf54e0c7cad7adcb8ac855b47d98a7e513a..054c2d4e7739a67b55c6e6354d044c6260c14259 100644
--- a/ui/views/examples/progress_bar_example.cc
+++ b/ui/views/examples/progress_bar_example.cc
@@ -16,7 +16,7 @@ namespace {
const double kStepSize = 0.1;
-double ClampToMin(double percent) {
+double SetToMax(double percent) {
return std::min(std::max(percent, 0.0), 1.0);
}
@@ -61,9 +61,9 @@ void ProgressBarExample::CreateExampleView(View* container) {
void ProgressBarExample::ButtonPressed(Button* sender, const ui::Event& event) {
if (sender == minus_button_)
- current_percent_ = ClampToMin(current_percent_ - kStepSize);
+ current_percent_ = SetToMax(current_percent_ - kStepSize);
else if (sender == plus_button_)
- current_percent_ = ClampToMin(current_percent_ + kStepSize);
+ current_percent_ = SetToMax(current_percent_ + kStepSize);
progress_bar_->SetValue(current_percent_);
}
« no previous file with comments | « ui/views/controls/tabbed_pane/tabbed_pane.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698