-
Notifications
You must be signed in to change notification settings - Fork 921
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
Toolbar: hide the profile button if there is only 1 user profile #3097
Conversation
@@ -136,6 +152,16 @@ void BraveToolbarView::OnThemeChanged() { | |||
bookmark_->UpdateImage(); | |||
} | |||
|
|||
void BraveToolbarView::OnProfileAdded(const base::FilePath& profile_path) { |
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 callback only called only when new normal profile is created?
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.
@simonhong I don't see this getting called when starting / opening a guest or tor profile. Are there any other non-normal profiles I should check?
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.
If we don't need to check about tor/guest profile add/delete, I think current impl is fine.
FYI, we can get all profile creation by NOTIFICATION_PROFILE_XXX
notifications.
Profile* profile = browser()->profile(); | ||
|
||
// Track changes in profile count | ||
profile_observer_.Add( |
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.
Should we skip this for Tor/Guest?
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.
Good point
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.
done @mkarolin
23e1968
to
45a03ee
Compare
Feedback addressed |
45a03ee
to
2375d4c
Compare
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.
++
CI did pass |
@bsclifton this was added to the app menu for all platforms in brave/brave-browser#5212 |
Create a New Profile in the app menu is the way to add a new profile. With just one profile, we could have 'Manage Profiles' in Settings though it's not necessarily intuitive to Add a user that way. It would be go to Settings, Manage Profile, Add a Profile versus going to App menu and selecting Create a New Profile. Not sure we need a second entry point. |
Fix brave/brave-browser#5091
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
New automated browser tests also cover most of the following...
Fresh profle
Open 1 or more windows
--> Profile button is now shown
Open the guest window
--> Profile button is shown
Open incognito / tor window
--> Profile button is shown
Create a new profile (on macos use the System menu, on other OS wait until App Menu gets Create Profile and Switch to Guest Profile items #3096 provides the app menu action!)
---> Profile button is shown on original profile window
---> Profile button is shown on new profile window
Delete profile (click on profile button, then Manage profiles, then the menu button on one of the profiles, then remove profile, then confirm!)
---> Profile button is not shown on existing remaining profile window
Reviewer Checklist:
After-merge Checklist:
changes has landed on.