Chromium Code Reviews| Index: ui/views/controls/slider.cc |
| diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc |
| index dd1148ff1a59123e6f2c960404aee5ffe732267c..8ba08edb9e4c80eb1afb30c1bb1ac0aacef177db 100644 |
| --- a/ui/views/controls/slider.cc |
| +++ b/ui/views/controls/slider.cc |
| @@ -176,6 +176,10 @@ float Slider::GetAnimatingValue() const{ |
| : value_; |
| } |
| +void Slider::SetHighlighted(bool focus) { |
| + return; |
|
bruthig
2016/09/22 21:05:24
nit: Remove
yiyix
2016/09/23 20:35:37
Highlight needs a default implementation, so non_m
bruthig
2016/09/23 22:24:39
I was just asking you to remove the return; statem
|
| +} |
| + |
| bool Slider::OnMousePressed(const ui::MouseEvent& event) { |
| if (!event.IsOnlyLeftMouseButton()) |
| return false; |
| @@ -207,11 +211,13 @@ bool Slider::OnKeyPressed(const ui::KeyEvent& event) { |
| } |
| void Slider::OnFocus() { |
| + SetHighlighted(true); |
| View::OnFocus(); |
| SchedulePaint(); |
| } |
| void Slider::OnBlur() { |
| + SetHighlighted(false); |
| View::OnBlur(); |
| SchedulePaint(); |
| } |
| @@ -241,8 +247,12 @@ void Slider::OnGestureEvent(ui::GestureEvent* event) { |
| } |
| void Slider::AnimationProgressed(const gfx::Animation* animation) { |
| - animating_value_ = animation->CurrentValueBetween(animating_value_, value_); |
| - SchedulePaint(); |
| + if (move_animation_.get() && (animation == move_animation_.get())) { |
|
bruthig
2016/09/22 21:05:24
nit: Checking that |move_animation_| here is redun
|
| + float old_animating_value = animating_value_; |
| + animating_value_ = animation->CurrentValueBetween(animating_value_, value_); |
| + if (animating_value_ != old_animating_value) |
| + SchedulePaint(); |
| + } |
| } |
| void Slider::GetAccessibleState(ui::AXViewState* state) { |
| @@ -253,11 +263,13 @@ void Slider::GetAccessibleState(ui::AXViewState* state) { |
| } |
| void Slider::OnSliderDragStarted() { |
| + SetHighlighted(true); |
| if (listener_) |
| listener_->SliderDragStarted(this); |
| } |
| void Slider::OnSliderDragEnded() { |
| + SetHighlighted(false); |
| if (listener_) |
| listener_->SliderDragEnded(this); |
| } |