| OLD | NEW |
| 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 "views/controls/progress_bar.h" | 5 #include "views/controls/progress_bar.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
| 12 #include "third_party/skia/include/effects/SkGradientShader.h" | 13 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 13 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" | |
| 14 #include "ui/base/accessibility/accessible_view_state.h" | 14 #include "ui/base/accessibility/accessible_view_state.h" |
| 15 #include "ui/gfx/canvas_skia.h" | 15 #include "ui/gfx/canvas_skia.h" |
| 16 #include "ui/gfx/color_utils.h" | 16 #include "ui/gfx/color_utils.h" |
| 17 #include "ui/gfx/font.h" | 17 #include "ui/gfx/font.h" |
| 18 #include "ui/gfx/insets.h" | 18 #include "ui/gfx/insets.h" |
| 19 #include "views/background.h" | 19 #include "views/background.h" |
| 20 #include "views/border.h" | 20 #include "views/border.h" |
| 21 #include "views/painter.h" | 21 #include "views/painter.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 bool ProgressBar::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) { | 299 bool ProgressBar::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) { |
| 300 DCHECK(tooltip); | 300 DCHECK(tooltip); |
| 301 if (tooltip == NULL) | 301 if (tooltip == NULL) |
| 302 return false; | 302 return false; |
| 303 tooltip->assign(UTF16ToWideHack(tooltip_text_)); | 303 tooltip->assign(UTF16ToWideHack(tooltip_text_)); |
| 304 return !tooltip_text_.empty(); | 304 return !tooltip_text_.empty(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void ProgressBar::SetEnabled(bool enabled) { | 307 void ProgressBar::OnEnabledChanged() { |
| 308 if (enabled == enabled_) | 308 View::OnEnabledChanged(); |
| 309 return; | |
| 310 View::SetEnabled(enabled); | |
| 311 // TODO(denisromanov): Need to switch progress bar color here? | 309 // TODO(denisromanov): Need to switch progress bar color here? |
| 312 } | 310 } |
| 313 | 311 |
| 314 void ProgressBar::GetAccessibleState(ui::AccessibleViewState* state) { | 312 void ProgressBar::GetAccessibleState(ui::AccessibleViewState* state) { |
| 315 state->role = ui::AccessibilityTypes::ROLE_PROGRESSBAR; | 313 state->role = ui::AccessibilityTypes::ROLE_PROGRESSBAR; |
| 316 state->state = ui::AccessibilityTypes::STATE_READONLY; | 314 state->state = ui::AccessibilityTypes::STATE_READONLY; |
| 317 } | 315 } |
| 318 | 316 |
| 319 } // namespace views | 317 } // namespace views |
| OLD | NEW |