Chromium Code Reviews| Index: ash/shelf/shelf_view.cc |
| diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc |
| index 5ab343329e7077c3761a20c9b8b526df0e6378c2..c298aaecfa12bfe948811e3a7e280b5adfc38fb1 100644 |
| --- a/ash/shelf/shelf_view.cc |
| +++ b/ash/shelf/shelf_view.cc |
| @@ -642,6 +642,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/05/17 23:03:30
nit: s/autohide/in auto-hide/ (or 'is not auto-hid
minch1
2017/05/26 23:01:11
update the comment according to next comment.
|
| + if (wm_shelf()->auto_hide_behavior() == SHELF_AUTO_HIDE_BEHAVIOR_NEVER) |
|
msw
2017/05/17 23:03:30
It's not clear to me how the comment above relates
minch1
2017/05/18 17:42:57
We cannot drag the shelf items when the shelf is a
msw
2017/05/18 20:42:20
Why won't the shelf itself correctly ignore drag t
minch1
2017/05/26 23:01:11
Done.
|
| + run_types |= views::MenuRunner::OWNER_NEEDS_DRAG; |
| + |
| 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) |