Commit 1ddae57b authored by Kevin Strohbehn's avatar Kevin Strohbehn Committed by Commit Bot

Prevent context menus from remaining open after a tablet mode transition

Bug: 891442
Change-Id: Ib173d99becdfc8924ddf382aeb0687c2bde1a145
Reviewed-on: https://chromium-review.googlesource.com/c/1317899
Commit-Queue: Kevin Strohbehn <ginko@google.com>
Reviewed-by: default avatarWeidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605569}
parent f522435e
......@@ -470,6 +470,9 @@ void AppsGridView::OnTabletModeChanged(bool started) {
if (item_view->item()->is_folder())
item_view->SetBackgroundBlurEnabled(started);
}
// Prevent context menus from remaining open after a transition
CancelContextMenusOnCurrentPage();
}
void AppsGridView::SetModel(AppListModel* model) {
......@@ -2463,6 +2466,8 @@ void AppsGridView::RemoveLastItemFromReparentItemFolderIfNecessary(
void AppsGridView::CancelContextMenusOnCurrentPage() {
GridIndex start_index(pagination_model_.selected_page(), 0);
if (!IsValidIndex(start_index))
return;
int start = GetModelIndexFromIndex(start_index);
int end =
std::min(view_model_.view_size(), start + TilesPerPage(start_index.page));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment