Commit 7c6430c1 authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Close bookmark menus before executing 'Open All'

When a user command-clicks on a nested bookmark bar folder to open all,
we pop up a dialog to ask if they're sure if the number of tabs that
would be opened exceeds some minimum. Currently, we do this *before*
we dismiss the menu, which (at least on the Mac) closes on a later run
loop as the result of a focus change.

This causes some issues on Mac, including a mouse capture induced
crash and accessibility inconsistencies (see bug for both).

This change disables the code that keeps the bookmark menu open on
background open if the node is a folder.

Bug: 1105587
Change-Id: Iba0ffb0746a9caab0484df22ab40f49ef554ff2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299530
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789490}
parent 6cc174b8
...@@ -193,9 +193,16 @@ void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) { ...@@ -193,9 +193,16 @@ void BookmarkMenuDelegate::ExecuteCommand(int id, int mouse_event_flags) {
bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu( bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu(
int id, int id,
const ui::Event& event) { const ui::Event& event) {
return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && if ((event.flags() & ui::EF_LEFT_MOUSE_BUTTON) &&
ui::DispositionFromEventFlags(event.flags()) == ui::DispositionFromEventFlags(event.flags()) ==
WindowOpenDisposition::NEW_BACKGROUND_TAB; WindowOpenDisposition::NEW_BACKGROUND_TAB) {
DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end());
const BookmarkNode* node = menu_id_to_node_map_[id];
// Close the menu before opening a folder since this may pop up a dialog
// over the menu. See https://crbug.com/1105587 for details.
return node->type() != BookmarkNode::FOLDER;
}
return false;
} }
bool BookmarkMenuDelegate::GetDropFormats( bool BookmarkMenuDelegate::GetDropFormats(
......
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