Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 416343003: Do not handle ui::ET_GESTURE_END events in CustomButton (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b1cf301ac914c3851ede77ff51c06336d50ecb3a 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -228,22 +228,21 @@ void CustomButton::OnGestureEvent(ui::GestureEvent* event) {
}
if (event->type() == ui::ET_GESTURE_TAP && IsTriggerableEvent(*event)) {
- // Set the button state to hot and start the animation fully faded in. The
- // GESTURE_END event issued immediately after will set the state to
- // STATE_NORMAL beginning the fade out animation. See
- // http://crbug.com/131184.
+ // In order to provide visual feedback that the user has tapped on
+ // the button, show the hover state fully faded in immediately after
+ // a tap. Setting the state back to normal begins the fade-out animation.
SetState(STATE_HOVERED);
hover_animation_->Reset(1.0);
NotifyClick(*event);
event->StopPropagation();
+ SetState(STATE_NORMAL);
} else if (event->type() == ui::ET_GESTURE_TAP_DOWN &&
ShouldEnterPushedState(*event)) {
SetState(STATE_PRESSED);
if (request_focus_on_press_)
RequestFocus();
event->StopPropagation();
- } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL ||
- event->type() == ui::ET_GESTURE_END) {
+ } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL) {
SetState(STATE_NORMAL);
}
if (!event->handled())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698