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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 DCHECK(tooltip); | 176 DCHECK(tooltip); |
177 *tooltip = tooltip_text_; | 177 *tooltip = tooltip_text_; |
178 return !tooltip_text_.empty(); | 178 return !tooltip_text_.empty(); |
179 } | 179 } |
180 | 180 |
181 void ProgressBar::GetAccessibleState(ui::AXViewState* state) { | 181 void ProgressBar::GetAccessibleState(ui::AXViewState* state) { |
182 state->role = ui::AX_ROLE_PROGRESS_INDICATOR; | 182 state->role = ui::AX_ROLE_PROGRESS_INDICATOR; |
183 state->AddStateFlag(ui::AX_STATE_READ_ONLY); | 183 state->AddStateFlag(ui::AX_STATE_READ_ONLY); |
184 } | 184 } |
185 | 185 |
186 gfx::Size ProgressBar::GetPreferredSize() { | 186 gfx::Size ProgressBar::GetPreferredSize() const { |
187 gfx::Size pref_size(100, 11); | 187 gfx::Size pref_size(100, 11); |
188 gfx::Insets insets = GetInsets(); | 188 gfx::Insets insets = GetInsets(); |
189 pref_size.Enlarge(insets.width(), insets.height()); | 189 pref_size.Enlarge(insets.width(), insets.height()); |
190 return pref_size; | 190 return pref_size; |
191 } | 191 } |
192 | 192 |
193 const char* ProgressBar::GetClassName() const { | 193 const char* ProgressBar::GetClassName() const { |
194 return kViewClassName; | 194 return kViewClassName; |
195 } | 195 } |
196 | 196 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 // Draw bar stroke | 314 // Draw bar stroke |
315 StrokeRoundRect(canvas, | 315 StrokeRoundRect(canvas, |
316 bar_left, bar_top, progress_width, bar_height, | 316 bar_left, bar_top, progress_width, bar_height, |
317 kCornerRadius, | 317 kCornerRadius, |
318 enabled() ? kBarBorderColor : kDisabledBarBorderColor, | 318 enabled() ? kBarBorderColor : kDisabledBarBorderColor, |
319 kBorderWidth); | 319 kBorderWidth); |
320 } | 320 } |
321 } | 321 } |
322 | 322 |
323 } // namespace views | 323 } // namespace views |
OLD | NEW |