| Index: views/controls/button/custom_button.cc
|
| diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc
|
| index 5f8e82e3c67017734a12bf856116e8366ca1fce5..55acba8f4c75d397a89b3c22b13689b5a666c0d4 100644
|
| --- a/views/controls/button/custom_button.cc
|
| +++ b/views/controls/button/custom_button.cc
|
| @@ -129,9 +129,8 @@ bool CustomButton::OnMouseDragged(const MouseEvent& event) {
|
| return true;
|
| }
|
|
|
| -void CustomButton::OnMouseReleased(const MouseEvent& event, bool canceled) {
|
| - // Starting a drag results in a MouseReleased, we need to ignore it.
|
| - if ((state_ == BS_DISABLED) || InDrag())
|
| +void CustomButton::OnMouseReleased(const MouseEvent& event) {
|
| + if (state_ == BS_DISABLED)
|
| return;
|
|
|
| if (!HitTest(event.location())) {
|
| @@ -140,13 +139,19 @@ void CustomButton::OnMouseReleased(const MouseEvent& event, bool canceled) {
|
| }
|
|
|
| SetState(BS_HOT);
|
| - if (!canceled && IsTriggerableEvent(event)) {
|
| + if (IsTriggerableEvent(event)) {
|
| NotifyClick(event);
|
| // NOTE: We may be deleted at this point (by the listener's notification
|
| // handler).
|
| }
|
| }
|
|
|
| +void CustomButton::OnMouseCaptureLost() {
|
| + // Starting a drag results in a MouseCaptureLost, we need to ignore it.
|
| + if (state_ != BS_DISABLED && !InDrag())
|
| + SetState(BS_NORMAL);
|
| +}
|
| +
|
| void CustomButton::OnMouseEntered(const MouseEvent& event) {
|
| if (state_ != BS_DISABLED)
|
| SetState(BS_HOT);
|
|
|