2e2024b5118bf2b208fd8492667f080aebcd9dcd
This commit adds a new user preference that allows users to disable the middle-click-to-close tab functionality, addressing user feedback that accidental middle-clicks can cause unwanted tab closures. Changes include: **Browser Preferences:** - Add kTabsCloseOnMiddleClick pref (default: true) in brave_tab_prefs.h - Register preference in brave_prefs_util.cc for settings UI exposure **UI Implementation:** - Extend TabSlotController interface with CanCloseTabViaMiddleButtonClick() - Implement pref checking in BraveTabStrip via base class override - Override TabSlotController methods in tab_strip.h/cc to respect preference - Add chromium_src overrides for FakeTabSlotController and FakeBaseTabStripController to support testing infrastructure **Tab Click Handling:** - Patch tab.cc to check controller preference before handling middle clicks - Use plaster.toml rewrite for cleaner code transformation - Maintain existing behavior when preference is enabled (default) **Settings UI:** - Add "Close tabs on middle click" toggle to Appearance > Tabs settings - Include localized strings in brave_settings_strings.grdp
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
Brave Core
Brave Core is a set of changes, APIs, and scripts used for customizing Chromium to make the Brave browser. Please also check https://github.com/brave/brave-browser
Follow @brave on Twitter for important announcements.
Resources
Community
You can ask questions and interact with the community in the following locations:
- Brave Community
communitychannel on Brave Software's Slack
Languages
C++
36.9%
HTML
31.6%
Swift
9.4%
TypeScript
9%
Java
4.8%
Other
8.1%