-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide other bookmarks #3620
Hide other bookmarks #3620
Conversation
e2f0a49
to
a4cfdee
Compare
31be5b5
to
1e0da64
Compare
chromium_src/components/bookmarks/browser/bookmark_model_unittest.cc
Outdated
Show resolved
Hide resolved
chromium_src/components/bookmarks/browser/bookmark_model_unittest.cc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, STR passes
|
||
// other_node should remain hidden | ||
#define BRAVE_IS_VISIBLE \ | ||
if (type() == OTHER_NODE) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we use ChromeBookmarkClient::IsPermanentNodeVisible
? That's how MOBILE is displayed on android/ios and hidden on desktop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meaning subclass ChromeBookmarkClient
if we haven't already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, you already have BraveBookmarkClient::IsPermanentNodeVisible
so why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the patch was originally return visible_
to get rid of !children().empty()
.
Then I pulled upstream unit test to run and expect it to be just invisible without override TestBookmarkClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason that other node is not always empty listed here
https://github.com/brave/brave-core/pull/3620/files#r335092116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in 3f388ed
|
||
// Move bookmarks under "Other Bookmarks" permanent node to a same name folder | ||
// at the end of "Bookmark Bar" permanent node | ||
void BookmarkModel::MigrateOtherNode() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are any of these calls private? Can't we just pass the BookmarkModel in to a method somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 122272a
|
||
// And put the bookmark bar and other nodes at the end of the list. | ||
items_.push_back(Item(model->bookmark_bar_node(), Item::TYPE_NODE)); | ||
+ BRAVE_RECENTLY_USED_FOLDERS_COMBO_MODEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we subclass this with an override in BookmarkBubbleView
and then call
RemoveNode(model->other_node());
in the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 456a86f
// If the "Other Bookmarks" folder has any content, make a submenu for it and | ||
// fill it in. | ||
- if (!model->other_node()->children().empty()) { | ||
+ BRAVE_BUILD_ROOT_MENU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed? The other node will always be empty now, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not always, chromium sync uses it as a temporary place to put foster children
https://cs.chromium.org/chromium/src/components/sync_bookmarks/bookmark_change_processor.cc?l=619&rcl=74cefac725837520ab3d553eb2fa531e5ee02f63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 3f388ed
bool has_other_children = !model_->other_node()->children().empty(); | ||
bool update_other = | ||
has_other_children != other_bookmarks_button_->GetVisible(); | ||
+ BRAVE_UPDATE_OTHER_AND_MANAGED_BUTTONS_VISIBILITY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed since has_other_children
is false so it will set the visibility of the button to false here? https://github.com/brave/brave-core/pull/3620/files#diff-b3cabb3a3f40d70b6d97898b3f71b98fR19 so this is also maybe not needed? https://github.com/brave/brave-core/pull/3620/files#diff-b3cabb3a3f40d70b6d97898b3f71b98fR9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_other_children
will not always be true https://github.com/brave/brave-core/pull/3620/files#r335092116
and
https://github.com/brave/brave-core/pull/3620/files#diff-b3cabb3a3f40d70b6d97898b3f71b98fR9
is to prevent it from drawing separator (BookmarkBarView::UpdateBookmarksSeparatorVisibility
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I'm saying has_other_children
will always be false
so other_bookmarks_button_->SetVisible(has_other_children);
will always be set to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 3f388ed
… bookmarks under it to the same name folder at the end of "Bookmarks Bar" permanent node
and persistently hide other_node
(ignore the temporary visibility by adding foster parent in chromium sync)
122272a
to
48f3202
Compare
|
||
private: | ||
// BookmarkClient: | ||
bool IsPermanentNodeVisible(const BookmarkPermanentNode* node) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what we're doing here. Changing this in a test-only bookmark client doesn't seem to really validate anything useful for us in the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 0f076bb
…delLoaded to avoid duplication
b821950
to
1cd5cb7
Compare
fix brave/brave-browser#5158
Need brave/brave-browser#6344 for rename completely work
This PR make "Other Bookmarks" invisible and prevent user from adding bookmarks into "Other Bookmarks". Existing bookmarks in "Other Bookmarks" will be moved under the same name folder under "Bookmarks"(Bookmarks Bar).
We also rename "Bookmarks Bar" to "Bookmarks" in
Bookmarks Manager
,[Always] Show Bookmarks Bar
in mac menu, menu and setting pageSubmitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Bookmarks Bar to Bookmarks
chrome://bookmarks/
chrome://settings/?search=bookmarks
Hide Other Bookmarks with sync disabled
3.1 Bookmarks Bar
3.2 Bookmarks Manager
3.3 Main menu on Mac
3.4 Menu on all platforms
3.5 Bookmarks Icon
3.6 Edit Bookmark Dialog
Hide Other Bookmarks with sync enabled
Reviewer Checklist:
After-merge Checklist:
changes has landed on.