| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 indeterminate_bar_animation_->SetDuration(2000); // In milliseconds. | 110 indeterminate_bar_animation_->SetDuration(2000); // In milliseconds. |
| 111 indeterminate_bar_animation_->Start(); | 111 indeterminate_bar_animation_->Start(); |
| 112 } else { | 112 } else { |
| 113 indeterminate_bar_animation_.reset(); | 113 indeterminate_bar_animation_.reset(); |
| 114 SchedulePaint(); | 114 SchedulePaint(); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 SkColor ProgressBar::GetForegroundColor() const { | 118 SkColor ProgressBar::GetForegroundColor() const { |
| 119 return GetNativeTheme()->GetSystemColor( | 119 return GetNativeTheme()->GetSystemColor( |
| 120 ui::NativeTheme::kColorId_CallToActionColor); | 120 ui::NativeTheme::kColorId_ProminentButtonColor); |
| 121 } | 121 } |
| 122 | 122 |
| 123 SkColor ProgressBar::GetBackgroundColor() const { | 123 SkColor ProgressBar::GetBackgroundColor() const { |
| 124 // The default foreground is GoogleBlue500, and the default background is | 124 // The default foreground is GoogleBlue500, and the default background is |
| 125 // that color but 80% lighter. | 125 // that color but 80% lighter. |
| 126 return color_utils::BlendTowardOppositeLuma(GetForegroundColor(), 0xCC); | 126 return color_utils::BlendTowardOppositeLuma(GetForegroundColor(), 0xCC); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void ProgressBar::AnimationProgressed(const gfx::Animation* animation) { | 129 void ProgressBar::AnimationProgressed(const gfx::Animation* animation) { |
| 130 DCHECK_EQ(animation, indeterminate_bar_animation_.get()); | 130 DCHECK_EQ(animation, indeterminate_bar_animation_.get()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 AddPossiblyRoundRectToPath(slice_bounds, &slice_path); | 200 AddPossiblyRoundRectToPath(slice_bounds, &slice_path); |
| 201 | 201 |
| 202 SkPaint slice_paint; | 202 SkPaint slice_paint; |
| 203 slice_paint.setStyle(SkPaint::kFill_Style); | 203 slice_paint.setStyle(SkPaint::kFill_Style); |
| 204 slice_paint.setFlags(SkPaint::kAntiAlias_Flag); | 204 slice_paint.setFlags(SkPaint::kAntiAlias_Flag); |
| 205 slice_paint.setColor(GetForegroundColor()); | 205 slice_paint.setColor(GetForegroundColor()); |
| 206 canvas->DrawPath(slice_path, slice_paint); | 206 canvas->DrawPath(slice_path, slice_paint); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace views | 209 } // namespace views |
| OLD | NEW |