Fix drag and drop bookmark reordering [chromium/src : main]

1 view
Skip to first unread message

Yuheng Huang (Gerrit)

unread,
Jan 8, 2026, 7:54:52 PM (3 days ago) Jan 8
to Dominic Austria, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Dominic Austria

Yuheng Huang added 1 comment

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 1324, Patchset 5 (Latest): menu->AppendSeparator();
Yuheng Huang . unresolved

I wonder if we can mark this element as LAST_PERMANENT_MENU_ITEM_ID with View::SetID() and get the index from the menu to add to from AddBookmarkNode instead of hard coding the offset?

Open in Gerrit

Related details

Attention is currently required from:
  • Dominic Austria
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 5
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-CC: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: Dominic Austria <dominic...@google.com>
Gerrit-Comment-Date: Fri, 09 Jan 2026 00:54:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuheng Huang (Gerrit)

unread,
Jan 9, 2026, 6:26:07 PM (2 days ago) Jan 9
to Dominic Austria, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Dominic Austria

Yuheng Huang added 4 comments

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 201, Patchset 12:bool ShouldAppendOpenAllCommands(const BookmarkParentFolder& folder) {
Yuheng Huang . unresolved

This function is a bit misleading. Even if it returns true, if the bookmark folder has no bookmarks we don't append open all commands. Same as AppendOpenAllCommandItems(). Can just inline all the code like before since it does not need to reuse it elsewhere.

Line 217, Patchset 12: // TODO use ElementTrackerviews perhaps here
if (!menu->HasSubmenu()) {
return 0;
}
Yuheng Huang . unresolved

What case is this? Can we remove it if the code below already handle it?

Line 877, Patchset 12: if (ShouldAppendOpenAllCommands(new_parent_folder)) {
Yuheng Huang . unresolved

I think we don't need to check here. If the separator is not found we can just don't add the offset.

Line 1330, Patchset 12:void BookmarkMenuDelegate::AppendOpenAllCommandItems(
Yuheng Huang . unresolved

Also inline this?

Open in Gerrit

Related details

Attention is currently required from:
  • Dominic Austria
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 13
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-CC: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: Dominic Austria <dominic...@google.com>
Gerrit-Comment-Date: Fri, 09 Jan 2026 23:25:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dominic Austria (Gerrit)

unread,
Jan 10, 2026, 12:27:57 PM (yesterday) Jan 10
to Yuheng Huang, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Yuheng Huang

Dominic Austria added 4 comments

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 201, Patchset 12:bool ShouldAppendOpenAllCommands(const BookmarkParentFolder& folder) {
Yuheng Huang . resolved

This function is a bit misleading. Even if it returns true, if the bookmark folder has no bookmarks we don't append open all commands. Same as AppendOpenAllCommandItems(). Can just inline all the code like before since it does not need to reuse it elsewhere.

Dominic Austria

Done

Line 217, Patchset 12: // TODO use ElementTrackerviews perhaps here
if (!menu->HasSubmenu()) {
return 0;
}
Yuheng Huang . unresolved

What case is this? Can we remove it if the code below already handle it?

Dominic Austria

I am just worried that if it doesn't have a Submenu, we will crash on the next line where we dereference menu->GetSubmenu(). Not sure when this will happen though.

Line 877, Patchset 12: if (ShouldAppendOpenAllCommands(new_parent_folder)) {
Yuheng Huang . resolved

I think we don't need to check here. If the separator is not found we can just don't add the offset.

Dominic Austria

Done

Line 1324, Patchset 5: menu->AppendSeparator();
Yuheng Huang . resolved

I wonder if we can mark this element as LAST_PERMANENT_MENU_ITEM_ID with View::SetID() and get the index from the menu to add to from AddBookmarkNode instead of hard coding the offset?

Dominic Austria

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Yuheng Huang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 17
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-CC: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: Yuheng Huang <yuh...@chromium.org>
Gerrit-Comment-Date: Sat, 10 Jan 2026 17:27:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yuheng Huang <yuh...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Dominic Austria (Gerrit)

unread,
Jan 10, 2026, 12:29:40 PM (yesterday) Jan 10
to Yuheng Huang, David Pennington, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from David Pennington and Yuheng Huang

Dominic Austria added 1 comment

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 1330, Patchset 12:void BookmarkMenuDelegate::AppendOpenAllCommandItems(
Yuheng Huang . unresolved

Also inline this?

Dominic Austria

I guess I could, I know this function isnt used anywhwere else but I wanted to keep BookmarkMenuDelegate::BuildMenu small and readable

Open in Gerrit

Related details

Attention is currently required from:
  • David Pennington
  • Yuheng Huang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 17
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: David Pennington <dpen...@chromium.org>
Gerrit-Comment-Date: Sat, 10 Jan 2026 17:29:33 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Dominic Austria (Gerrit)

unread,
Jan 10, 2026, 12:32:56 PM (yesterday) Jan 10
to Yuheng Huang, David Pennington, Chromium LUCI CQ, chromium...@chromium.org

Dominic Austria added 2 comments

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 202, Patchset 17 (Latest): if (!menu->HasSubmenu()) {
Dominic Austria . unresolved

I probably can remove this but I am just worried that if it doesn't have a Submenu, we will crash on the next line where we dereference menu->GetSubmenu(). Not sure when this will happen though.

Line 217, Patchset 12: // TODO use ElementTrackerviews perhaps here
if (!menu->HasSubmenu()) {
return 0;
}
Yuheng Huang . resolved

What case is this? Can we remove it if the code below already handle it?

Dominic Austria

I am just worried that if it doesn't have a Submenu, we will crash on the next line where we dereference menu->GetSubmenu(). Not sure when this will happen though.

Dominic Austria

made a new thread since i updated the code section

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 17
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Yuheng Huang <yuh...@chromium.org>
Gerrit-Comment-Date: Sat, 10 Jan 2026 17:32:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yuheng Huang <yuh...@chromium.org>
Comment-In-Reply-To: Dominic Austria <dominic...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

David Pennington (Gerrit)

unread,
Jan 10, 2026, 7:23:05 PM (22 hours ago) Jan 10
to Dominic Austria, Yuheng Huang, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Dominic Austria

David Pennington added 1 comment

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 1358, Patchset 17 (Latest): menu_items[1]->SetEnabled(false);
David Pennington . unresolved

do we want to update the strings as well in this case? if theres a way to get rid of the if else expression i would prefer that since its less error prone.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominic Austria
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 17
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: Dominic Austria <dominic...@google.com>
Gerrit-Comment-Date: Sun, 11 Jan 2026 00:22:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dominic Austria (Gerrit)

unread,
Jan 10, 2026, 8:25:30 PM (21 hours ago) Jan 10
to Yuheng Huang, David Pennington, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from David Pennington and Yuheng Huang

Dominic Austria added 1 comment

File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
Line 1358, Patchset 17 (Latest): menu_items[1]->SetEnabled(false);
David Pennington . unresolved

do we want to update the strings as well in this case? if theres a way to get rid of the if else expression i would prefer that since its less error prone.

Dominic Austria

It turns out when I call GetPluralStringFUTF16(IDS_BOOKMARK_BAR_OPEN_ALL_COUNT, open_count) with open_count = 0 , the result is 'Open All'. So when updating the string, it transitions from 'Open Bookmark' (in enabled state) to 'Open All' in a disabled state. I wrote this if else condition because I thought it was nicer to disable the menu item without the string text updating. In case you don't know what I'm talking about, the video I sent you shows what I'm trying to describe more clearly

Open in Gerrit

Related details

Attention is currently required from:
  • David Pennington
  • Yuheng Huang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia924e003c1eaebe0dd162ca1b14276b086c89748
Gerrit-Change-Number: 7411413
Gerrit-PatchSet: 17
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: Yuheng Huang <yuh...@chromium.org>
Gerrit-Attention: David Pennington <dpen...@chromium.org>
Gerrit-Comment-Date: Sun, 11 Jan 2026 01:25:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: David Pennington <dpen...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages