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

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

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased Created 4 years, 6 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
« ash/shell.h ('K') | « ui/views/animation/ink_drop_host_view.cc ('k') | 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 50cffe9286fcc6ac39dfada288b17e2d92949d50..a2b8bb29a88917ce4d08798a0ac7659fd5511bc1 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -163,15 +163,17 @@ bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
bool CustomButton::OnMouseDragged(const ui::MouseEvent& event) {
if (state_ != STATE_DISABLED) {
bool should_enter_pushed = ShouldEnterPushedState(event);
+ bool should_show_pending =
bruthig 2016/06/17 17:58:45 nit: const, and should probably be consistent and
mohsen 2016/06/18 06:25:15 Done.
+ should_enter_pushed && notify_action_ == NOTIFY_ON_RELEASE && !InDrag();
if (HitTestPoint(event.location())) {
SetState(should_enter_pushed ? STATE_PRESSED : STATE_HOVERED);
- if (!InDrag() && should_enter_pushed &&
+ if (should_show_pending &&
ink_drop()->GetTargetInkDropState() == views::InkDropState::HIDDEN) {
AnimateInkDrop(views::InkDropState::ACTION_PENDING);
}
} else {
SetState(STATE_NORMAL);
- if (!InDrag() && should_enter_pushed &&
+ if (should_show_pending &&
ink_drop()->GetTargetInkDropState() ==
views::InkDropState::ACTION_PENDING) {
AnimateInkDrop(views::InkDropState::HIDDEN);
« ash/shell.h ('K') | « ui/views/animation/ink_drop_host_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698