Chromium Code Reviews| Index: ash/shelf/shelf_button.cc |
| diff --git a/ash/shelf/shelf_button.cc b/ash/shelf/shelf_button.cc |
| index f8c930d29ce9c4c65a5441bc013f0b3692b0ba3f..db766c2b14a70fb472de4e218f28d6aec784dfb5 100644 |
| --- a/ash/shelf/shelf_button.cc |
| +++ b/ash/shelf/shelf_button.cc |
| @@ -26,6 +26,7 @@ |
| #include "ui/views/animation/ink_drop_impl.h" |
| #include "ui/views/animation/square_ink_drop_ripple.h" |
| #include "ui/views/controls/image_view.h" |
| +#include "ui/views/controls/menu/menu_controller.h" |
| namespace { |
| @@ -461,6 +462,14 @@ void ShelfButton::OnGestureEvent(ui::GestureEvent* event) { |
| shelf_view_->PointerReleasedOnButton(this, ShelfView::TOUCH, false); |
| event->SetHandled(); |
| return; |
| + case ui::ET_GESTURE_LONG_TAP: { |
| + views::MenuController* controller = |
|
msw
2017/05/17 23:03:30
Can you comment on what this is doing and why?
minch1
2017/05/18 17:42:57
1.LONG_PRESS the shelf items until the context men
msw
2017/05/18 20:42:20
It's not clear to me (at least from that explanati
minch1
2017/05/18 22:02:53
We handled the LONG_TAP here to make it will not o
msw
2017/05/18 22:14:47
Right, I don't understand *why* we don't want the
|
| + views::MenuController::GetActiveInstance(); |
| + if (controller) |
| + controller->set_owner_needs_gesture_events(false); |
|
sky
2017/05/18 16:33:30
Instead of changing the menu code, could you accom
minch1
2017/05/18 17:42:57
I think the reason we need to transfer events here
xiyuan
2017/05/18 18:00:47
Each widget has a GestureProvider that translates
sky
2017/05/18 19:43:12
Why is that a problem though? Shouldn't the user c
minch1
2017/05/18 22:02:53
I guess this is a requirement from UX?
|
| + event->SetHandled(); |
| + return; |
| + } |
| default: |
| return CustomButton::OnGestureEvent(event); |
| } |