Commit Graph
66 Commits
Author SHA1 Message Date
Brian R. Bondy 53985f7beb Update CSA-053: distinguish workarounds from permanent design decisions (#34996)
Clarify that CSA-053 only applies to temporary workarounds, not
permanent design decisions. Comments explaining why an alternative
API was not used due to a known limitation do not need TODO tracking
issues when the current code is the intended long-term solution.
2026-03-25 16:48:16 -04:00
Brian R. Bondy bdd31d10f5 Fix stale wiki link in patching docs (#35000)
The wiki content was moved into the docs folder, so the external
link to brave-browser/wiki/Patching-Chromium#making-methods-virtual
now just redirects. Use a local anchor instead.
2026-03-25 15:14:04 -04:00
Brian R. Bondy 92aae1ccc6 Update network endpoint best practices (#34906)
Clarify that network auditor entries are only needed for
endpoints that do not require user opt-in. Add new best
practice (BS-056) requiring all new Brave endpoints be
added to the HSTS pin list.
2026-03-24 08:44:56 -04:00
Brian R. Bondy 0b14f04c96 Remove ARCH-052 mojom default values best practice (#34912)
Mojom code generation already value-initializes all struct fields
via the default constructor, making explicit defaults redundant.
2026-03-24 08:22:20 -04:00
Sangwoo Ko ce0f439a19 [Tree Tabs] Support tab groups in tree tab strip (#34826)
* Support tab groups in tree tab strip

Integrate tab groups with the tree tab strip so that groups are represented
as a single tree node wrapping the group (not one tree node per tab). Tabs
inside a group remain direct children of the group collection.

Collection and delegate:
- BraveTreeTabStripCollectionDelegate: When adding a tab with new_group_id,
  add to collection without wrapping in a tree node; the group wraps it.
  MoveTabsRecursive: handle empty tab_indices (no-op when moving within same
  group), and route move-out-of-group and move-into-group to new helpers.
- MoveTabsIntoGroup: unwrap tabs from tree nodes (or detach from other
  groups), add to target group; when group is detached (new group), wrap
  group in a TreeTabNode and attach at the correct tree position.
- MoveTabsOutOfGroup: move tabs from TabGroupTabCollection back into the
  tree by wrapping each in a tree node at the destination index.
- BraveTabStripCollection: add PopDetachedGroupCollectionForDelegate and
  GetTreeTabNodeIdForGroup; chromium_src TabStripCollection gains virtual
  GetTreeTabNodeIdForGroup. BraveTabStripCollectionDelegate implements
  GetTreeTabNodeIdForGroup.

TreeTabNodeTabCollection:
- BuildTreeTabs: wrap entire groups in one tree node (processed_groups set);
  grouped tabs stay as direct children of the group.
- New constructor that wraps a TabGroupTabCollection (for creating a group
  in tree mode). Single-tab constructor allows null for GetEmptyTreeTabNode
  when a tab was moved into a group and the view still holds the old node id.

Model, controller, and UI:
- BraveTabStripModel::GetTreeTabNodeIdForGroup returns the tree node id for
  a group (or nullptr if tree tabs off). Wired through controller and
  BraveTabStripCollection.
- BraveBrowserTabStripController::GetTreeTabNode returns GetEmptyTreeTabNode()
  when the node is null (e.g. tab just moved into group, before
  TabGroupedStateChanged/AddTabToGroup updates the view).
- OnTreeTabChanged: handle tab index kNoTab and detached state during group
  creation; avoid double-clearing when AddTabToGroup will clear the node id.
- BraveTabStrip::AddTabToGroup override sets the tab's tree_tab_node from
  GetTreeTabNodeIdForGroup when adding to a group in tree mode.
2026-03-24 11:18:48 +01:00
Mihai PLESA ae8356fda8 readme migrate from b-b (#34734) 2026-03-23 09:27:39 -07:00
Brian R. Bondy 54d0a15d3a Add best practice: keep PRs focused on a single purpose (#34891) 2026-03-23 11:11:47 -04:00
Anthony Tseng c11e31c388 Add best practice: don't rely on implicit const char* to string_view for non-null-terminated data (#34866) 2026-03-20 13:37:45 -07:00
Brian R. BondyandClaude Opus 4.6 1f1b6b01cb Update TUF-004: don't use sanitizer-specific filters when upstream flakes broadly (#34874)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:20:59 -04:00
Netzenbot 5bb907f22d Add best practices doc for handling upstream docs (#34864)
Add upstream test failures best practices doc

Consolidates upstream-flake filter guidance from testing-isolation.md
(TI-031, TI-032, TI-041, TI-042, TI-043) and patches.md (PATCH-011)
into a dedicated testing-upstream-failures.md. Expands the flake-check
section with full script usage and the LUCI verdict table.
2026-03-20 12:22:23 -04:00
Netzenbot 249704cfca Rename BEST-PRACTICES.md to best_practices.md (#34861)
Update all internal references in skill docs.
2026-03-20 11:23:36 -04:00
Anthony Tseng 5947ff35a8 Revert "Add best practice: use base::as_string_view() for compile-time string length" (#34853)
Revert "Add best practice: use base::as_string_view() for compile-time string…"

This reverts commit 20abc50120.
2026-03-20 11:05:43 +00:00
Anthony Tseng 20abc50120 Add best practice: use base::as_string_view() for compile-time string length (#34838)
Add best practice: use base::as_string_view() for compile-time string length (#34830)
2026-03-19 11:09:40 -07:00
Sangwoo Ko b7a3eeb712 [Tree Tabs] Add split tab support for tree tabs (#34659)
* Add split tab support for tree tabs

In order to support split tabs in tree tabs, mainly we need to reimplment
two methods - CreateSplit and Unsplit.

For CreateSplit, we need to wrap the split tabs in a tree node, and insert it
at the position.
For Unsplit, we need to extract the tabs back to the tree nodes.

- TabStripCollection: virtual CreateSplit, Unsplit, AddCollectionMapping,
  RemoveCollectionMapping; AddTabCollectionAtPosition for delegate.

- BraveTabStripCollection(delegate): override CreateSplit/Unsplit and
  AddCollectionMapping/RemoveCollectionMapping; PassKey overloads for
  AddTabCollectionAtPosition and collection mapping.

- BraveTreeTabStripCollectionDelegate: implement CreateSplit (wrap split in
  tree node, insert at position), Unsplit (extract tabs back to tree nodes),
  AddCollectionMapping/RemoveCollectionMapping for TREE_NODE holding split/group;
  MoveTabsRecursive same-position handling for split/group creation.

- Tab strip API: handle TREE_NODE in tab_converters (unpinned container).

- Docs: tree tabs + split tabs flow and MoveTabsRecursive behavior.
2026-03-17 16:02:52 +09:00
Brian R. Bondy e88f2476b2 Add best practice: use public to restrict header visibility (#34743) 2026-03-15 13:55:46 -04:00
Brian R. Bondy 628bd598c7 Update best practices for feature flags and buildflag confusion (#34722)
* Update best practice: feature flags for significant or experimental features

* Update best practice: clarify buildflag vs feature flag confusion
2026-03-13 18:26:40 -04:00
Brian R. Bondy 8b74765985 Add best practice: PRs should include reasonable test coverage (#34696)
* Add best practice: PRs should include reasonable test coverage

* Add best practice: Use chromium_src include pattern to test upstream overrides
2026-03-12 23:11:13 -04:00
AlexeyBarabash e8302c177f Android settings search indexes (#34576)
Added support for search indexes for Brave preferences fragments
2026-03-12 23:20:56 +02:00
Brian R. Bondy 391da523ab Add Claude skills documentation (#34603) 2026-03-10 10:53:54 -04:00
Aleksei Khoroshilov ce76e01a49 Support contained tabs session restore and sync. (#33313)
* Support contained tabs session restore and sync.

* Review fixes.

* Use struct as a return value instead of optional with out args.

* Add a unit test for view-source: scheme.

* Move TabRestore helper to components.

* Add containers-specific SerializedNavigationBuilder* tests.

* Guard PageState.top.url_string use.

* Add plaster files for few patches.

* Replace browser_tabrestore.cc #define patch with plaster rewrite.

* Replace content_serialized_navigation_builder.cc change with rewrite.

* Fix gn check.

* Add prefix_length check.

* Improve rewrite rules.

* Guard PageState changes with buildflag.

* Rename StoragePartitionKeyToUrlPrefix.

* Add buildflag check into SerializedNavigationEntry.

* Fix build issues with containers buildflag disabled.

* Fix iOS build.
2026-03-10 19:20:50 +07:00
Brian R. Bondy 66d25b65b5 Import best-practice docs from brave-experiments/brave-core-tools (#34568) 2026-03-09 14:15:22 -04:00
Brian Johnson a9fa852335 Add link to plaster best practices in plaster.md (#34517) 2026-03-06 13:43:03 +00:00
Sangwoo Ko 6a49c03cd0 [Tree Tabs] Make TreeTabModel::SetCollapsed/DoesBelongToCollapsedNode() (#34380)
* Make TreeTabModel::SetCollapsed/DoesBelongToCollapsedNode()

TreeTabModel:
- Cache closest collapsed ancestor per node for O(1) visibility checks.
- Add SetCollapsed(id, collapsed) as UI entry point; calls TreeTabNode::set_collapsed()
  and updates cache for affected descendants.
- Add DoesBelongToCollapsedNode(id) for quick "under collapsed" queries.
- Update cache in AddTreeTabNode (new node's closest collapsed), RemoveTreeTabNode
  (recompute nodes that had removed id as closest), and OnTreeTabNodeMoved (recompute
  moved node and its descendants after reparent).

TreeTabNode:
- Add GetClosestCollapsedAncestorId(), IsUnderCollapsedAncestor(), CollectDescendantIds()
  for cache maintenance and tree traversal.

TreeTabNodeTabCollection:
- Add on_move callback; BuildTreeTabs and constructor take on_move.
- OnReparented invokes on_move so TreeTabModel can refresh collapse cache.
- Change on_create signature from void(const TreeTabNode&) to void(TreeTabNode&) so
  delegate can pass AddTreeTabNode (non-const).

BraveTreeTabStripCollectionDelegate:
- Wire on_move to TreeTabModel::OnTreeTabNodeMoved in BuildTreeTabs and in
  single-node TreeTabNodeTabCollection creation sites.
2026-03-05 08:00:19 +09:00
Jay Harris b51cdea900 [docs]: Add a basic overview of frontend testing (#29795) 2026-02-26 22:59:16 +00:00
Artem Samoilenko 79cb1bbb57 [cr145][Android] Replace JavaParamRef -> JavaRef
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/0d6ec7e0f328e9ddd6f5174f61676ff85c777af6

commit 0d6ec7e0f328e9ddd6f5174f61676ff85c777af6
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Tue Dec 2 12:37:02 2025 -0800

    Android: Replace JavaParamRef -> JavaRef (part 5)

    JavaParamRef used to be different, but now is an alias for JavaRef.

    Bug: 40173007
    Change-Id: I9bfa2fcdd012fc90859886ee2e747cb360733421
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7217772
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Owners-Override: Andrew Grieve <agrieve@chromium.org>
    Reviewed-by: Martin Kong <martinkong@google.com>
    Cr-Commit-Position: refs/heads/main@{#1553033}
2026-01-29 13:40:24 -05:00
Aleksei Khoroshilov 110a7e5a42 siso: Include linux toolchain build dependencies. (#32882) 2025-12-22 19:54:36 +01:00
Aleksei Khoroshilov 77b59c1342 siso: Adjust fs_min_flush_timeout value. (#32883) 2025-12-18 23:31:57 +09:00
Aleksei Khoroshilov d1378a7989 Support native RBE in Siso. (#32719)
* Support native RBE in Siso.

* Move sisoenv configuration to gclient custom vars.

* Small adjustments to generation/docs.
2025-12-15 13:16:44 +07:00
Sangwoo Ko 046971c6be Add docs for tree tab architecture (#32520)
This document outlines the planned architecture and design principles
behind the tree tab feature. It covers the responsibilities of
various components, data structures, and interaction patterns to ensure
a cohesive and decoupled implementation.
2025-11-28 01:08:06 +01:00
Brian Johnson 9ebf64af83 Reorganize patching doc (#32512) 2025-11-25 06:14:42 -07:00
Brian Johnson c31f54c9ef Add docs for using forward declarations to minimize dependencies in chromium_src and patches (#32486) 2025-11-24 17:45:14 +01:00
Brian Johnson 0a037ec253 Add docs for stubbing implementations (#32487)
Add docs explaining when replacing upstream implementations is generally acceptable
2025-11-24 09:39:38 -07:00
Brian Johnson 03782c8697 Merge wiki into rust.md (#32475)
Merge the wiki entry into the doc and remove parts that were not correct
2025-11-21 14:01:34 -07:00
Brian Johnson 8d27af6429 Move patching docs to brave-core (#32407)
Copied from https://github.com/brave/brave-browser/wiki/Patching-Chromium
2025-11-18 15:24:54 -07:00
Brian Johnson 7e0819d219 Convert sources.gni codeowner to semgrep (#32229)
see https://github.com/brave/security-action/pull/869
2025-11-17 14:01:26 -07:00
Aleksei Khoroshilov 690938f72c Add docs about ignoring format/presubmit checks. (#32313)
* Add docs about ignoring format/presubmit checks.

* Add java and swift info.

* Sort python info.

* Add link to swift-format doc on ignoring source.
2025-11-17 20:21:59 +07:00
Kyle Hickinson f7fd019e83 Add note about test service creation in keyed service factories (#31984) 2025-10-25 13:18:48 -04:00
Brian Johnson 81e9818897 Add additional information about GetBrowserContextToUse returning n… (#31694)
Factories should only return nullopt based on properties that don't change during the lifetime of a browser session
2025-10-08 05:08:01 -07:00
bridiver a4807cd2c2 update keyed service docs 2025-09-23 12:55:22 -07:00
bridiver 3f3fb0aa0b add docs for keyed service patterns 2025-09-23 12:37:09 -07:00
Brian Johnson ae46e9d54e Reland https://github.com/brave/brave-core/pull/31236 [plaster] Allow exactly one of pattern (exact match) or re_pattern (python regex) (#31373)
[plaster] allow exactly one of pattern or re_pattern

Plaster should allow either pattern (exact match) or re_pattern (regex match)
2025-09-24 04:08:33 +09:00
Brian Johnson 19ed9361d5 Revert "[plaster] Allow exactly one of pattern (exact match) or re_pattern (python regex)" (#31372)
Revert "[plaster] Allow exactly one of pattern (exact match) or re_pattern (p…"

This reverts commit 241617fc84.
2025-09-23 11:41:02 -07:00
Brian Johnson 241617fc84 [plaster] Allow exactly one of pattern (exact match) or re_pattern (python regex) (#31236)
Plaster should allow either pattern (exact match) or re_pattern (regex match)
2025-09-24 03:38:05 +09:00
Brian Johnson 068de867c9 [plaster] Check config count against the actual change count (#31238)
Check plaster config count against num_changes unless count == 0
2025-09-24 03:14:12 +09:00
Sangwoo Ko 4b0521b56b [Brave Midnight] Add Brave Midnight (Darker) theme feature and pref (#30520)
* Add Brave Midnight (Darker) theme feature

This commit introduces the Brave Midnight theme, a darker variant of the
existing dark theme, providing users with enhanced customization options
for their browsing experience.

Key changes:
* Add feature flag `kBraveMidnightTheme` to control theme availability
* Create new preference `kBraveDarkerMode` to store user's theme choice
* Implement UI toggle in Customize Chrome side panel for theme switching
* Add Mojo interface methods for theme state management

Technical implementation:
- Created `browser/ui/color/features.{cc,h}` for feature flag definition
- Added feature flag to `about_flags.cc` for experimental access
- Registered preference in `brave_profile_prefs.cc` when feature is enabled
- Extended Customize Chrome UI with `DarkerThemeToggle` component
- Added Mojo interface methods `GetUseDarkerTheme`/`SetUseDarkerTheme`

The feature is disabled by default and can be enabled via the
`brave-midnight-theme` flag in brave://flags. When enabled, users can
toggle the darker theme through the Customize Chrome side panel.
2025-08-26 08:58:43 +09:00
cdesouza-chromium c441a0daea Revert "[CodeHealth] Rotation Document (#30321)" (#30496)
This reverts commit 4a2b5342bf.
2025-08-06 16:41:18 +01:00
cdesouza-chromium 4a2b5342bf [CodeHealth] Rotation Document (#30321)
This is a proposed outline for a CodeHealth rotation.
2025-08-06 15:18:56 +01:00
Jay Harris 266cb4db0e [Brave News]: Use the new strings system for Brave News (#29847)
* [Brave News]: Migrate to new strings system

* [i18n]: Make it possible to combine const enums
2025-07-02 08:18:23 +12:00
cdesouza-chromium 407770c2cb [plaster] Adding plaster check (#29716)
This change adds a dry run mode to plaster, that can be called with:

```sh
tools/cr/plaster.py check
```

This command can also be called with a list of files, that can be either
`rewrite/` files or `patches/` files.

We are also adding support to plaster for .patchinfo files, allowing a
more efficient way to make sure any given plaster file has should be
regenerated.

### What does plaster do to .patchinfo files

Plaster now generates the contents of a .patchinfo file, and based on
that content it determines if one of these files must be updated:
source, patch, or patchinfo (a combination of npm run update_patches
and npm run apply_patches). A new key is being added to the patchinfo
format, namely, plaster, which is used to store the path and checksum
for the plaster file for a given patch/source set. Files are only
updated on disk if the resulting new content doesn't match the hash of
the file saved in disk.

For now plaster always produce a .patchfile when processing a plaster,
to avoid unnecessary writes and to confirm that submitted patches do
have the expected content. This may change in the future with a more
mature approach where the contents of the patchinfo file may be used
to avoid running all the plaster transformations. This means that for
now we have to pay for a full plaster generation to determine if a file
source/patch/patchinfo are out-of-date.

Resolves https://github.com/brave/brave-browser/issues/47066
2025-06-24 11:30:02 +01:00
Jay Harris 1c8f0ac7ec [explainers]: Update WebUI overriding explainer with a link to strings and note that storybook strings are automatic now. (#29620) 2025-06-18 06:55:36 +02:00