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

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

Issue 2840773003: views: Button ripple/highlight is visible during shelf swipe. (Closed)
Patch Set: Rebased. Created 3 years, 7 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
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ink_drop_host_view.h" 5 #include "ui/views/animation/ink_drop_host_view.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/scoped_target_handler.h" 9 #include "ui/events/scoped_target_handler.h"
10 #include "ui/gfx/color_palette.h" 10 #include "ui/gfx/color_palette.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 break; 68 break;
69 case ui::ET_GESTURE_LONG_PRESS: 69 case ui::ET_GESTURE_LONG_PRESS:
70 if (current_ink_drop_state == InkDropState::ACTIVATED) 70 if (current_ink_drop_state == InkDropState::ACTIVATED)
71 return; 71 return;
72 ink_drop_state = InkDropState::ALTERNATE_ACTION_PENDING; 72 ink_drop_state = InkDropState::ALTERNATE_ACTION_PENDING;
73 break; 73 break;
74 case ui::ET_GESTURE_LONG_TAP: 74 case ui::ET_GESTURE_LONG_TAP:
75 ink_drop_state = InkDropState::ALTERNATE_ACTION_TRIGGERED; 75 ink_drop_state = InkDropState::ALTERNATE_ACTION_TRIGGERED;
76 break; 76 break;
77 case ui::ET_GESTURE_END: 77 case ui::ET_GESTURE_END:
78 case ui::ET_GESTURE_SCROLL_BEGIN: 78 case ui::ET_GESTURE_TAP_CANCEL:
bruthig 2017/04/27 13:58:46 Do you know if a TAP_CANCEL happen whenever a SCRO
sammiequon 2017/04/28 04:58:03 Oops, I did not mean to remove the SCROLL_BEGIN he
79 if (current_ink_drop_state == InkDropState::ACTIVATED) 79 if (current_ink_drop_state == InkDropState::ACTIVATED)
80 return; 80 return;
81 ink_drop_state = InkDropState::HIDDEN; 81 ink_drop_state = InkDropState::HIDDEN;
82 break; 82 break;
83 default: 83 default:
84 return; 84 return;
85 } 85 }
86 86
87 if (ink_drop_state == InkDropState::HIDDEN && 87 if (ink_drop_state == InkDropState::HIDDEN &&
88 (current_ink_drop_state == InkDropState::ACTION_TRIGGERED || 88 (current_ink_drop_state == InkDropState::ACTION_TRIGGERED ||
bruthig 2017/04/27 13:58:46 Can you add a clause here so that we don't initiat
sammiequon 2017/04/28 04:58:03 Done.
89 current_ink_drop_state == InkDropState::ALTERNATE_ACTION_TRIGGERED || 89 current_ink_drop_state == InkDropState::ALTERNATE_ACTION_TRIGGERED ||
90 current_ink_drop_state == InkDropState::DEACTIVATED)) { 90 current_ink_drop_state == InkDropState::DEACTIVATED)) {
91 // These InkDropStates automatically transition to the HIDDEN state so we 91 // These InkDropStates automatically transition to the HIDDEN state so we
92 // don't make an explicit call. Explicitly animating to HIDDEN in this 92 // don't make an explicit call. Explicitly animating to HIDDEN in this
93 // case would prematurely pre-empt these animations. 93 // case would prematurely pre-empt these animations.
94 return; 94 return;
95 } 95 }
96 host_view_->AnimateInkDrop(ink_drop_state, event); 96 host_view_->AnimateInkDrop(ink_drop_state, event);
97 } 97 }
98 98
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 std::unique_ptr<InkDropImpl> 291 std::unique_ptr<InkDropImpl>
292 InkDropHostView::CreateDefaultFloodFillInkDropImpl() { 292 InkDropHostView::CreateDefaultFloodFillInkDropImpl() {
293 std::unique_ptr<views::InkDropImpl> ink_drop = 293 std::unique_ptr<views::InkDropImpl> ink_drop =
294 InkDropHostView::CreateDefaultInkDropImpl(); 294 InkDropHostView::CreateDefaultInkDropImpl();
295 ink_drop->SetAutoHighlightMode( 295 ink_drop->SetAutoHighlightMode(
296 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE); 296 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE);
297 return ink_drop; 297 return ink_drop;
298 } 298 }
299 299
300 } // namespace views 300 } // namespace views
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698