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

Side by Side Diff: ui/views/controls/progress_bar.cc

Issue 8909002: views: Convert IsEnabled() to just enabled() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/native_control_win.cc ('k') | ui/views/controls/resize_area.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 arraysize(background_colors), 214 arraysize(background_colors),
215 false); 215 false);
216 StrokeRoundRect(canvas, 216 StrokeRoundRect(canvas,
217 0, 0, 217 0, 0,
218 width(), height(), 218 width(), height(),
219 kCornerRadius, 219 kCornerRadius,
220 background_border_color, 220 background_border_color,
221 kBorderWidth); 221 kBorderWidth);
222 222
223 if (progress_width > 1) { 223 if (progress_width > 1) {
224 const bool enabled = IsEnabled(); 224 const SkColor bar_color_start = enabled() ?
225
226 const SkColor bar_color_start = enabled ?
227 SkColorSetRGB(100, 116, 147) : 225 SkColorSetRGB(100, 116, 147) :
228 SkColorSetRGB(229, 232, 237); 226 SkColorSetRGB(229, 232, 237);
229 const SkColor bar_color_end = enabled ? 227 const SkColor bar_color_end = enabled() ?
230 SkColorSetRGB(65, 73, 87) : 228 SkColorSetRGB(65, 73, 87) :
231 SkColorSetRGB(224, 225, 227); 229 SkColorSetRGB(224, 225, 227);
232 230
233 const SkColor bar_outer_color = enabled ? 231 const SkColor bar_outer_color = enabled() ?
234 SkColorSetRGB(0x4A, 0x4A, 0x4A) : 232 SkColorSetRGB(0x4A, 0x4A, 0x4A) :
235 SkColorSetARGB(0x80, 0x4A, 0x4A, 0x4A); 233 SkColorSetARGB(0x80, 0x4A, 0x4A, 0x4A);
236 234
237 const SkColor bar_inner_border_color = 235 const SkColor bar_inner_border_color =
238 SkColorSetARGB(0x3F, 0xFF, 0xFF, 0xFF); // 0.25 white 236 SkColorSetARGB(0x3F, 0xFF, 0xFF, 0xFF); // 0.25 white
239 const SkColor bar_inner_shadow_color = 237 const SkColor bar_inner_shadow_color =
240 SkColorSetARGB(0x54, 0xFF, 0xFF, 0xFF); // 0.33 white 238 SkColorSetARGB(0x54, 0xFF, 0xFF, 0xFF); // 0.33 white
241 239
242 // Draw bar background 240 // Draw bar background
243 FillRoundRect(canvas, 241 FillRoundRect(canvas,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 StrokeRoundRect(canvas, 308 StrokeRoundRect(canvas,
311 0, 0, 309 0, 0,
312 width(), height(), 310 width(), height(),
313 kCornerRadius, 311 kCornerRadius,
314 border_color, 312 border_color,
315 kBorderWidth); 313 kBorderWidth);
316 #endif 314 #endif
317 } 315 }
318 316
319 } // namespace views 317 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/native_control_win.cc ('k') | ui/views/controls/resize_area.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698