-
Notifications
You must be signed in to change notification settings - Fork 888
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
Make bookmark toggle on NTP whether bookmark is empty or not #2563
Conversation
!prefs->GetBoolean(bookmarks::prefs::kShowBookmarkBar)) | ||
return false; | ||
|
||
+ return 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.
Was expecting to see something like return !IsNTP(web_contents())
here. Is it safe to just return false here without further checks?
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.
@emerick I think this method is used for preventing bookmark bar visible or hidden opposite to the kShowBookmarkBar
prefs value.
When kShowBookmarkBar
is set to hidden, this method only returns true when active tab is NTP and bookmark bar isn't empty if all above conditions aren't met. So, we can hide bookmark bar on NTP by returning false here in this case.
When kShowBookmarkBar
is set to visible, this method isn't called except fullscreen condition.
According to the comment of Browser::ShouldHideUIForFullscreen()
, browser controls UI can be visible on MacOS fullscreen mode by sliding down. When Browser::ShouldHideUIForFullscreen()
returns true, this method will be called and we should also return false to hide bookmark bar.
So, I think returning false in here is safe.
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.
OK, got it.
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.
@emerick Thanks for quick review!
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.
LGTM
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.
Nice work! 😄👍
Fix brave/brave-browser#1306
Submitter Checklist:
npm test brave_unit_tests && npm test brave_browser_tests && npm run test-security
) onnpm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
yarn test brave_browser_tests --filter=BookmarkTabHelper*
Reviewer Checklist:
After-merge Checklist:
changes has landed on.