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

Side by Side Diff: ui/views/animation/button_ink_drop_delegate.cc

Issue 1832963002: MD - add ripples to DL shelf items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another TODO Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/animation/button_ink_drop_delegate.h" 5 #include "ui/views/animation/button_ink_drop_delegate.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/scoped_target_handler.h" 8 #include "ui/events/scoped_target_handler.h"
9 #include "ui/views/animation/ink_drop_animation_controller.h" 9 #include "ui/views/animation/ink_drop_animation_controller.h"
10 #include "ui/views/animation/ink_drop_animation_controller_factory.h" 10 #include "ui/views/animation/ink_drop_animation_controller_factory.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 InkDropState ink_drop_state = InkDropState::HIDDEN; 60 InkDropState ink_drop_state = InkDropState::HIDDEN;
61 switch (event->type()) { 61 switch (event->type()) {
62 case ui::ET_GESTURE_TAP_DOWN: 62 case ui::ET_GESTURE_TAP_DOWN:
63 ink_drop_state = InkDropState::ACTION_PENDING; 63 ink_drop_state = InkDropState::ACTION_PENDING;
64 // The ui::ET_GESTURE_TAP_DOWN event needs to be marked as handled so that 64 // The ui::ET_GESTURE_TAP_DOWN event needs to be marked as handled so that
65 // subsequent events for the gesture are sent to |this|. 65 // subsequent events for the gesture are sent to |this|.
66 event->SetHandled(); 66 event->SetHandled();
67 break; 67 break;
68 case ui::ET_GESTURE_LONG_PRESS: 68 case ui::ET_GESTURE_LONG_PRESS:
69 ink_drop_state = InkDropState::SLOW_ACTION_PENDING; 69 ink_drop_state = InkDropState::ALTERNATE_ACTION_PENDING;
70 break; 70 break;
71 case ui::ET_GESTURE_LONG_TAP: 71 case ui::ET_GESTURE_LONG_TAP:
72 ink_drop_state = InkDropState::SLOW_ACTION; 72 ink_drop_state = InkDropState::ALTERNATE_ACTION_TRIGGERED;
73 break; 73 break;
74 case ui::ET_GESTURE_END: 74 case ui::ET_GESTURE_END:
75 if (current_ink_drop_state == InkDropState::ACTIVATED) 75 if (current_ink_drop_state == InkDropState::ACTIVATED)
76 return; 76 return;
77 // Fall through to ui::ET_GESTURE_SCROLL_BEGIN case. 77 // Fall through to ui::ET_GESTURE_SCROLL_BEGIN case.
78 case ui::ET_GESTURE_SCROLL_BEGIN: 78 case ui::ET_GESTURE_SCROLL_BEGIN:
79 ink_drop_state = InkDropState::HIDDEN; 79 ink_drop_state = InkDropState::HIDDEN;
80 break; 80 break;
81 default: 81 default:
82 return; 82 return;
83 } 83 }
84 84
85 last_ink_drop_location_ = event->location();
86
85 if (ink_drop_state == InkDropState::HIDDEN && 87 if (ink_drop_state == InkDropState::HIDDEN &&
86 (current_ink_drop_state == InkDropState::QUICK_ACTION || 88 (current_ink_drop_state == InkDropState::ACTION_TRIGGERED ||
87 current_ink_drop_state == InkDropState::SLOW_ACTION || 89 current_ink_drop_state == InkDropState::ALTERNATE_ACTION_TRIGGERED ||
88 current_ink_drop_state == InkDropState::DEACTIVATED)) { 90 current_ink_drop_state == InkDropState::DEACTIVATED)) {
89 // These InkDropStates automatically transition to the HIDDEN state so we 91 // These InkDropStates automatically transition to the HIDDEN state so we
90 // don't make an explicit call. Explicitly animating to HIDDEN in this case 92 // don't make an explicit call. Explicitly animating to HIDDEN in this case
91 // would prematurely pre-empt these animations. 93 // would prematurely pre-empt these animations.
92 return; 94 return;
93 } 95 }
94 ink_drop_animation_controller_->AnimateToState(ink_drop_state); 96 ink_drop_animation_controller_->AnimateToState(ink_drop_state);
95 } 97 }
96 98
97 } // namespace views 99 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/button_ink_drop_delegate.h ('k') | ui/views/animation/flood_fill_ink_drop_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698