diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index ff7552999bd8..fa4ecf0ee3c0 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc @@ -1003,7 +1003,7 @@ ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState( return SHELF_AUTO_HIDE_SHOWN; } - if (shelf_widget_->IsShowingContextMenu()) + if (shelf_widget_->IsShowingMenu()) return SHELF_AUTO_HIDE_SHOWN; if (shelf_widget_->IsShowingOverflowBubble()) diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index 15f8ba6cf082..b1b741a7c92c 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc @@ -1994,8 +1994,9 @@ void ShelfView::AfterItemSelected( ShowMenu(std::make_unique( item.title, std::move(*menu_items), model_->GetShelfItemDelegate(item.id)), - sender, gfx::Point(), false, + sender, gfx::Point(), /*context_menu=*/false, ui::GetMenuSourceTypeForEvent(*event)); + shelf_->UpdateVisibilityState(); } else { ink_drop->AnimateToState(views::InkDropState::ACTION_TRIGGERED); } @@ -2015,7 +2016,7 @@ void ShelfView::AfterGetContextMenuItems( std::make_unique( std::move(menu_items), model_->GetShelfItemDelegate(shelf_id), display_id); - ShowMenu(std::move(menu_model), source, point, true /* context_menu */, + ShowMenu(std::move(menu_model), source, point, /*context_menu=*/true, source_type); } diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h index ebcf1e3ce7db..6ca975f08446 100644 --- a/ash/shelf/shelf_view.h +++ b/ash/shelf/shelf_view.h @@ -131,7 +131,8 @@ class ASH_EXPORT ShelfView : public views::View, // will be returned. gfx::Rect GetIdealBoundsOfItemIcon(const ShelfID& id); - // Returns true if we're showing a menu. + // Returns true if we're showing a menu. Note the menu could be either the + // context menu or the application select menu. bool IsShowingMenu() const; // Returns true if we're showing a menu for |view|. |view| could be a diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index 38c8fcd3a670..e4acb3833f8f 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc @@ -408,7 +408,7 @@ bool ShelfWidget::IsShowingAppList() const { return GetAppListButton() && GetAppListButton()->is_showing_app_list(); } -bool ShelfWidget::IsShowingContextMenu() const { +bool ShelfWidget::IsShowingMenu() const { return shelf_view_->IsShowingMenu(); } diff --git a/ash/shelf/shelf_widget.h b/ash/shelf/shelf_widget.h index afe8122503e2..d9310e99a638 100644 --- a/ash/shelf/shelf_widget.h +++ b/ash/shelf/shelf_widget.h @@ -81,7 +81,7 @@ class ASH_EXPORT ShelfWidget : public views::Widget, void PostCreateShelf(); bool IsShowingAppList() const; - bool IsShowingContextMenu() const; + bool IsShowingMenu() const; bool IsShowingOverflowBubble() const; // Sets the focus cycler. Also adds the shelf to the cycle.