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

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

Issue 1495753002: Make the material design ripple effect more visible on a quick action (single click or single tap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests and addressed comments from previous patch sets. Created 4 years, 11 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
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 3dfc48d6d4519dac0e81db37fc5c65870134c383..6a715cb8cc6b0fe86eadd7e95548fa203f868699 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -142,7 +142,8 @@ const char* CustomButton::GetClassName() const {
bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
if (state_ == STATE_DISABLED)
return true;
- if (ShouldEnterPushedState(event) && HitTestPoint(event.location())) {
+ if (state_ != STATE_PRESSED && ShouldEnterPushedState(event) &&
+ HitTestPoint(event.location())) {
SetState(STATE_PRESSED);
if (ink_drop_delegate_)
ink_drop_delegate_->OnAction(views::InkDropState::ACTION_PENDING);

Powered by Google App Engine
This is Rietveld 408576698