-
Notifications
You must be signed in to change notification settings - Fork 823
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
Add preference to en/disable Shared pinned tab #23797
Conversation
83851e0
to
47b785e
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.
++ 👍🏼
@@ -26,6 +26,8 @@ class BraveLocationBarModelDelegate : public BrowserLocationBarModelDelegate { | |||
const GURL& url, | |||
const std::u16string& formatted_url) const override; | |||
bool GetURL(GURL* url) const override; | |||
|
|||
raw_ptr<Browser> browser_; |
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.
nit: = nullptr
or raw_ref
?
[](base::WeakPtr<SharedPinnedTabService> service) { | ||
if (UNLIKELY(!service)) { | ||
// As BooleanPrefMember is already RAII style subscription, | ||
// this is unlikely to happen but theoretically might happen on |
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 do you think it's available in theory?
As shared_pinned_tab_enabled_
is member var of this service, it'll be destroyed before service is gone.
Also weak_ptr_factory_
is last declared member, so it should not be null when it's referred by other member vars.
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.
Right, I thought backward.
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.
Oh wait, shared_pinned_tab_enabled_ can be alive while weak_ptr_factory_ is invalidated, as destruction order is from the last? But still unlikely to happen as it's not accessed by multiple threads? I think making a method would be clear.
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.
Ah, right. it's invalidated at first than all others.
app/brave_settings_strings.grdp
Outdated
@@ -113,6 +113,9 @@ | |||
<message name="IDS_SETTINGS_APPEARANCE_SETTINGS_BRAVE_TAB_HOVER_MODE_TOOLTIP" desc="The label name of the tab hover mode where a tooltip with the site title is shown."> | |||
Tooltip | |||
</message> | |||
<message name="IDS_SETTINGS_APPEARANCE_SETTINGS_BRAVE_SHARED_PINNED_TAB" desc="The label name of a toggle button for Shared Pinned Tab feature"> | |||
Shared pinned tabs |
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.
@sangwoo108 can we be a little more descriptive here as to what this toggle would do? For example, Show pinned tabs in all windows
. cc: @rebron do we have a better wording for this feature? "Shared pinned tabs" as a settings toggle is not immediately obvious, imo.
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.
That's much better!
[puLL-Merge] - brave/brave-core@23797 DescriptionThis PR adds a new setting to enable/disable the "Shared Pinned Tab" feature in Brave. When enabled, pinned tabs are shared across all windows. The setting is exposed in the Appearance settings page. ChangesChanges
The other changes check the kSharedPinnedTab preference at various places to enable/disable the shared pinned tab behavior based on the preference value. Security HotspotsNone found. The changes handle a user-controlled preference properly without introducing any likely security issues. |
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.
strings
++
Resolves brave/brave-browser#38509
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: