Commit 7ea78451 authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Chromium LUCI CQ

Prevent quick answers menu from moving while menu is being populated.

Previously the Quick Answers view was added first to the context menu,
causing it to jump as items were added/removed to the menu.

Bug: b/173569669
Test: Manually deployed and verified we no longer get multiple |OnBoundariesChanged| events.
Change-Id: I6b8e52b7e24f653dcf033eb218c26b61f4de86e4
Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567183Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarYue Li <updowndota@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Jeroen Dhollander <jeroendh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833843}
parent 7e26ce46
...@@ -794,8 +794,6 @@ void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) { ...@@ -794,8 +794,6 @@ void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) {
void RenderViewContextMenu::InitMenu() { void RenderViewContextMenu::InitMenu() {
RenderViewContextMenuBase::InitMenu(); RenderViewContextMenuBase::InitMenu();
AppendQuickAnswersItems();
if (content_type_->SupportsGroup( if (content_type_->SupportsGroup(
ContextMenuContentType::ITEM_GROUP_PASSWORD)) { ContextMenuContentType::ITEM_GROUP_PASSWORD)) {
AppendPasswordItems(); AppendPasswordItems();
...@@ -947,6 +945,11 @@ void RenderViewContextMenu::InitMenu() { ...@@ -947,6 +945,11 @@ void RenderViewContextMenu::InitMenu() {
if (added_accessibility_labels_items && menu_model_.GetItemCount() == 1) { if (added_accessibility_labels_items && menu_model_.GetItemCount() == 1) {
menu_model_.RemoveItemAt(0); menu_model_.RemoveItemAt(0);
} }
// Always add Quick Answers view last, as it is rendered next to the context
// menu, meaning that each menu item added/removed in this function will cause
// it to visibly jump on the screen (see b/173569669).
AppendQuickAnswersItems();
} }
Profile* RenderViewContextMenu::GetProfile() const { Profile* RenderViewContextMenu::GetProfile() const {
......
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