Commit 1d1b230e authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Anchor ToolbarActionView context menu correctly

Makes ToolbarActionView::DoShowContextMenu use GetAnchorBoundsInScreen
which insets into the view to match the visible inkdrop hover effects.

Bug: chromium:800372
Change-Id: Ibe2bfe93547bae75590c87214e2c1ed0b73aa37b
Reviewed-on: https://chromium-review.googlesource.com/c/1281919Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600124}
parent 7a14b1d2
......@@ -300,9 +300,6 @@ void ToolbarActionView::DoShowContextMenu(
DCHECK(visible()); // We should never show a context menu for a hidden item.
gfx::Point screen_loc;
ConvertPointToScreen(this, &screen_loc);
int run_types =
views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU;
if (delegate_->ShownInsideMenu())
......@@ -323,7 +320,7 @@ void ToolbarActionView::DoShowContextMenu(
menu_ = menu_adapter_->CreateMenu();
menu_runner_.reset(new views::MenuRunner(menu_, run_types));
menu_runner_->RunMenuAt(parent, this, gfx::Rect(screen_loc, size()),
menu_runner_->RunMenuAt(parent, this, GetAnchorBoundsInScreen(),
views::MENU_ANCHOR_TOPLEFT, source_type);
}
......
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