Commit 9877705b authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Don't request menu items twice.

During long press, we request menu options twice. Avoid making this
expensive call twice.

Before, we returned early on the callback. Keep that incase race
conditions, but also return early before the request if a menu already
exists.

Bug: 907556
Change-Id: Ie7798e25faea5128651f4a06415d978a5a6cbe35
Reviewed-on: https://chromium-review.googlesource.com/c/1347090Reviewed-by: default avatarWeidong Guo <weidongg@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610113}
parent e8dabedb
......@@ -494,6 +494,8 @@ void AppListItemView::OnContextMenuModelReceived(
void AppListItemView::ShowContextMenuForView(views::View* source,
const gfx::Point& point,
ui::MenuSourceType source_type) {
if (context_menu_ && context_menu_->IsShowingMenu())
return;
// Prevent multiple requests for context menus before the current request
// completes. If a second request is sent before the first one can respond,
// the Chrome side delegate will become unresponsive
......
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