| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/controls/progress_bar.h" | 5 #include "ui/views/controls/progress_bar.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ProgressBar::SetValue(double value) { | 163 void ProgressBar::SetValue(double value) { |
| 164 if (value != current_value_) { | 164 if (value != current_value_) { |
| 165 current_value_ = value; | 165 current_value_ = value; |
| 166 SchedulePaint(); | 166 SchedulePaint(); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 void ProgressBar::SetTooltipText(const string16& tooltip_text) { | 170 void ProgressBar::SetTooltipText(const base::string16& tooltip_text) { |
| 171 tooltip_text_ = tooltip_text; | 171 tooltip_text_ = tooltip_text; |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool ProgressBar::GetTooltipText(const gfx::Point& p, string16* tooltip) const { | 174 bool ProgressBar::GetTooltipText(const gfx::Point& p, |
| 175 base::string16* tooltip) const { |
| 175 DCHECK(tooltip); | 176 DCHECK(tooltip); |
| 176 *tooltip = tooltip_text_; | 177 *tooltip = tooltip_text_; |
| 177 return !tooltip_text_.empty(); | 178 return !tooltip_text_.empty(); |
| 178 } | 179 } |
| 179 | 180 |
| 180 void ProgressBar::GetAccessibleState(ui::AccessibleViewState* state) { | 181 void ProgressBar::GetAccessibleState(ui::AccessibleViewState* state) { |
| 181 state->role = ui::AccessibilityTypes::ROLE_PROGRESSBAR; | 182 state->role = ui::AccessibilityTypes::ROLE_PROGRESSBAR; |
| 182 state->state = ui::AccessibilityTypes::STATE_READONLY; | 183 state->state = ui::AccessibilityTypes::STATE_READONLY; |
| 183 } | 184 } |
| 184 | 185 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // Draw bar stroke | 314 // Draw bar stroke |
| 314 StrokeRoundRect(canvas, | 315 StrokeRoundRect(canvas, |
| 315 bar_left, bar_top, progress_width, bar_height, | 316 bar_left, bar_top, progress_width, bar_height, |
| 316 kCornerRadius, | 317 kCornerRadius, |
| 317 enabled() ? kBarBorderColor : kDisabledBarBorderColor, | 318 enabled() ? kBarBorderColor : kDisabledBarBorderColor, |
| 318 kBorderWidth); | 319 kBorderWidth); |
| 319 } | 320 } |
| 320 } | 321 } |
| 321 | 322 |
| 322 } // namespace views | 323 } // namespace views |
| OLD | NEW |