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

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

Issue 2178163002: Add ink drop ripple to shelf overflow button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created separate fixtures for overflow button tests + Cleanup Created 4 years, 4 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 | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | 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 85dc33627b1d853aebe03296affa86e9b96f3618..4e76eff3a3049aabdc99902052cd1cad0343dd56 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -184,6 +184,8 @@ bool CustomButton::OnMouseDragged(const ui::MouseEvent& event) {
}
void CustomButton::OnMouseReleased(const ui::MouseEvent& event) {
+ const bool was_pressed = state_ == STATE_PRESSED;
+
if (state_ != STATE_DISABLED) {
if (!HitTestPoint(event.location())) {
SetState(STATE_NORMAL);
@@ -197,7 +199,7 @@ void CustomButton::OnMouseReleased(const ui::MouseEvent& event) {
}
}
}
- if (notify_action_ == NOTIFY_ON_RELEASE)
+ if (notify_action_ == NOTIFY_ON_RELEASE && was_pressed)
bruthig 2016/09/01 16:12:54 Correct me if I'm wrong but you said that OnClickC
mohsen 2016/09/10 03:03:23 Not exactly. Probably, what I meant was that OnCli
OnClickCanceled(event);
}
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698