Chromium Code Reviews| Index: ash/shelf/shelf_view.cc |
| diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc |
| index b8c65bc101c8aeac9c4d8efd7ee74bc451e6d508..79fd14cc9d13a838ec0f127c8e1cd643f99089a4 100644 |
| --- a/ash/shelf/shelf_view.cc |
| +++ b/ash/shelf/shelf_view.cc |
| @@ -640,6 +640,8 @@ bool ShelfView::ShouldEventActivateButton(View* view, const ui::Event& event) { |
| void ShelfView::PointerPressedOnButton(views::View* view, |
| Pointer pointer, |
| const ui::LocatedEvent& event) { |
| + if (IsShowingMenu()) |
| + launcher_menu_runner_->Cancel(); |
| if (drag_view_) |
| return; |
| @@ -1656,7 +1658,7 @@ void ShelfView::ShowContextMenuForView(views::View* source, |
| last_pressed_index_ = -1; |
| const ShelfItem* item = ShelfItemForView(source); |
| - if (!item) { |
| + if (!item || item->type == TYPE_APP_LIST) { |
| ShellPort::Get()->ShowContextMenu(context_menu_point, source_type); |
| return; |
| } |
| @@ -1687,6 +1689,11 @@ void ShelfView::ShowMenu(std::unique_ptr<ui::MenuModel> menu_model, |
| if (context_menu) |
| run_types |= |
| views::MenuRunner::CONTEXT_MENU | views::MenuRunner::FIXED_ANCHOR; |
| + |
| + // Shelf items can only be dragged if the shelf is not autohide. |
|
msw
2017/06/01 20:24:27
repeated nit: s/autohide/in auto-hide/ (or 'is not
minch1
2017/06/23 23:13:02
Done.
|
| + if (shelf()->auto_hide_behavior() == SHELF_AUTO_HIDE_BEHAVIOR_NEVER) |
| + run_types |= views::MenuRunner::PRESERVE_CURRENT_GESTURE_FOR_OWNER; |
| + |
| launcher_menu_runner_.reset( |
| new views::MenuRunner(menu_model_adapter_->CreateMenu(), run_types)); |
| @@ -1739,10 +1746,6 @@ void ShelfView::ShowMenu(std::unique_ptr<ui::MenuModel> menu_model, |
| void ShelfView::OnMenuClosed(views::InkDrop* ink_drop) { |
| context_menu_id_ = ShelfID(); |
| - // Hide the hide overflow bubble after showing a context menu for its items. |
| - if (owner_overflow_bubble_) |
| - owner_overflow_bubble_->Hide(); |
| - |
| closing_event_time_ = launcher_menu_runner_->closing_event_time(); |
| if (ink_drop) |