| Index: ui/views/controls/button/custom_button.cc
|
| diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
|
| index 1b5d1e82ffbd705b332ed9ce3057a60a8d2da995..2f29a6da67adddab77c636532e338f15b49f01bc 100644
|
| --- a/ui/views/controls/button/custom_button.cc
|
| +++ b/ui/views/controls/button/custom_button.cc
|
| @@ -167,18 +167,18 @@ void CustomButton::OnMouseCaptureLost() {
|
| }
|
|
|
| void CustomButton::OnMouseEntered(const ui::MouseEvent& event) {
|
| - if (state_ != STATE_DISABLED)
|
| + if (state_ != STATE_DISABLED && ShouldRespondToMouseMovement())
|
| SetState(STATE_HOVERED);
|
| }
|
|
|
| void CustomButton::OnMouseExited(const ui::MouseEvent& event) {
|
| // Starting a drag results in a MouseExited, we need to ignore it.
|
| - if (state_ != STATE_DISABLED && !InDrag())
|
| + if (state_ != STATE_DISABLED && !InDrag() && ShouldRespondToMouseMovement())
|
| SetState(STATE_NORMAL);
|
| }
|
|
|
| void CustomButton::OnMouseMoved(const ui::MouseEvent& event) {
|
| - if (state_ != STATE_DISABLED)
|
| + if (state_ != STATE_DISABLED && ShouldRespondToMouseMovement())
|
| SetState(HitTestPoint(event.location()) ? STATE_HOVERED : STATE_NORMAL);
|
| }
|
|
|
| @@ -328,6 +328,10 @@ CustomButton::CustomButton(ButtonListener* listener)
|
| hover_animation_->SetSlideDuration(kHoverFadeDurationMs);
|
| }
|
|
|
| +bool CustomButton::ShouldRespondToMouseMovement() {
|
| + return true;
|
| +}
|
| +
|
| void CustomButton::StateChanged() {
|
| }
|
|
|
|
|