Commit Graph
100 Commits
Author SHA1 Message Date
Brian R. Bondy 4dd860c0ae Remove CSM-002 best practice (#35734) 2026-04-21 16:08:30 -04:00
Brian R. Bondy efab59a346 Update Brave Origin copy (#35717) 2026-04-21 14:51:30 -04:00
Brian R. Bondy fe0b0c3173 Hide Survey Panelist when rewards is disabled by admin policy (#35663)
The previous fix (brave/brave-core#35600) used
brave_origin::IsBraveOriginPurchased() which calls
PrefService::GetBoolean() directly. This crashed because the ads code
calls UserHasOptedInToSurveyPanelist() from a DB worker thread via
Mojo, violating PrefService's UI-thread sequence check.

Instead, gate Survey Panelist on the BraveRewardsDisabled admin policy
pref (kDisabledByPolicy). Origin builds set this policy so the effect
is the same, but the pref access in the ads internal code goes through
GetProfileBooleanPref() → Mojo IPC, which is thread-safe.

Resolves https://github.com/brave/brave-browser/issues/54584
Resolves https://github.com/brave/brave-browser/issues/54718
2026-04-21 07:34:04 -04:00
Brian R. Bondy c774078d83 Revert "Hide Survey Panelist in settings for Origin builds" (#35660)
Revert "Hide Survey Panelist in settings for Origin builds (#35600)"

This reverts commit 05f2dae16a.
2026-04-19 09:22:55 -04:00
Brian R. Bondy a83c9e48ae Remove duplicate favicon_product.png sources (#35639)
These files in build/chromium/resources/ targeted the same destination
as the explicit per-branding product_logo_16.png copy added in #35566,
causing branding.js to re-copy and overwrite the destination on every
run. Removing them so a single source writes favicon_product.png.
2026-04-17 18:40:50 -04:00
Brian R. Bondy 05f2dae16a Hide Survey Panelist in settings for Origin builds (#35600)
* Hide Survey Panelist in settings for Origin builds

Resolves brave/brave-browser#54584

* Also handle Brave Origin upgrade case for Survey Panelist

Extend the Origin check to `IsBraveOriginPurchased()` so users who
upgrade a regular build to Brave Origin also see the Survey Panelist
row hidden, and force the backend opt-in check and the virtual pref
`[virtual]:is_survey_panelist` to `false` on Origin so the feature
does not remain active (90-day ad event retention, ads targeting) for
users who previously opted in.
2026-04-17 16:49:12 -04:00
Brian R. Bondy 6fbf1c1ae6 Hide chevron on Brave Origin reset to defaults row (#35632)
The reset to defaults row on chrome://settings/origin is an action
button, not a link to another page, so the trailing chevron was
misleading. Hide it via the cr-link-row icon part.
2026-04-17 15:19:39 -04:00
Brian R. Bondy 7b35a31f99 Remove Switch to Brave Search banners for Brave Origin (#35595)
Hide Switch to Brave Search banners for Brave Origin

Suppress the omnibox and NTP Brave Search conversion banners on
is_brave_origin_branded=true builds, and on non-branded builds when
Brave Origin has been purchased.
2026-04-16 16:03:51 -04:00
Brian R. Bondy ab5b72f16d Fix cookies page settings override after upstream 3PCD cleanup (#35543)
* Fix cookies page settings override after upstream 3PCD cleanup

Chromium removed the dom-if template with
`is3pcdRedesignEnabled_` as part of the 3PCD experiment cleanup.
The #generalControls element still exists but is no longer wrapped
in a conditional template, so find it directly on templateContent
like the other elements.

* Fix settings search crash in site settings page

The getAssociatedControlFor override was using querySelector on the
page's shadow root, but list item link rows (e.g. #autoplay, #ethereum)
are rendered inside settings-site-settings-list shadow DOMs. The
querySelector couldn't find them, falling through to the base mixin's
assertNotReached().

Search through the list components' shadow DOMs instead.
2026-04-15 23:35:02 -04:00
Brian R. Bondy 042c70ef95 Fix chrome://version favicon race on Origin builds (#35566)
Fix chrome://version favicon race showing wrong icon on Origin builds

The version page favicon (IDR_PRODUCT_FAVICON) was always the standard
Brave icon regardless of Origin branding. On Origin builds this caused
the wrong icon to appear in the tab and omnibox.

Fix by copying the branding-specific product_logo_16.png as
favicon_product.png via branding.js based on isBraveOriginBranded —
the same pattern used for product_logo.png and product_logo_white.png.
2026-04-15 23:34:00 -04:00
Brian R. Bondy 7fb7c7af69 Disable Chromium's default PDF viewer infobar (#35556)
The kPdfInfoBar feature (enabled by default in Chromium) prompts users
to set Chrome as the default PDF viewer. Brave should not show this
Chrome-specific upsell.
2026-04-15 22:24:29 -04:00
Brian R. Bondy 3ffd6902bc Fix Origin branded build settings page issues (#35545)
* Hide Origin settings page in branded Origin builds

In is_brave_origin_branded builds, the browser itself is the Origin
product, so the Origin settings page is redundant and should not appear
in the settings menu or search results.

* Guard Leo settings page insertion with enable_ai_chat

The Leo page import was already wrapped in // <if expr="enable_ai_chat">
but the template insertion into the view manager was not. When
enable_ai_chat is off, the element class is never registered, but the
page visibility Proxy defaults missing properties to true, so the
element gets stamped as an unregistered HTMLElement with no
searchContents method, crashing the entire settings search.
2026-04-15 14:57:55 -04:00
Brian R. Bondy fdc6cc59e9 Fix Linux free tier proceed button on Origin settings page (#35481)
Add Linux free tier proceed option to Origin settings page

Add chrome://flags entry for Brave Origin, enable the feature flag
by default on all platforms (including Linux), and add a "Proceed
with Origin for free on Linux" button to the settings onboarding
page. The proceed functionality is compile-time gated to Linux only.
2026-04-14 23:44:22 -04:00
Brian R. Bondy ee619d9d9a Enable Brave Origin by default and add chrome://flags entry (#35484)
Enable the kBraveOrigin feature flag by default on all platforms
and add a chrome://flags entry so it can be toggled for testing.
2026-04-14 23:43:34 -04:00
Brian R. Bondy 754872677b Open origin settings on first purchase (#35460)
* Open Origin settings page on first purchase detection

- Add Delegate interface to BraveOriginService for browser-layer actions
- Watch skus::prefs::kSkusState changes to re-check purchase state
  when credentials update (e.g. after purchasing on account.brave.com)
- On first purchase detection, open brave://settings/origin via the
  delegate so the user can configure Origin policies
- Add BraveOriginNavigationDelegate (browser layer) implementing the
  delegate using chrome::ShowSettingsSubPageForProfile
- Move navigation impl to its own source_set to avoid adding sources
  directly to browser/ui/BUILD.gn
- Add unit tests for delegate, one-shot behavior, and pref-triggered
  recheck

* Address review feedback on PR #35460

- Move Delegate from SetDelegate() setter to constructor parameter
  per ARCH-025 (constructor injection over setter methods)
- Add //chrome/browser/ui dep in browser/ui/brave_origin/BUILD.gn
  for chrome_pages.h include per BS-012
- Move //brave/components/brave_origin to public_deps in
  browser/brave_origin/BUILD.gn since the header exposes it per BS-024

* Guard brave_origin UI dep on !is_android

chrome::ShowSettingsSubPageForProfile is only compiled for desktop
(chrome_pages.cc is in the !is_android sources block). Move the
//brave/browser/ui/brave_origin dep and its allow_circular_includes_from
entry behind !is_android to fix the Android linker error.

* Address remaining review feedback on PR #35460

- Move SkusServiceGetter into Delegate::GetSkusService() so the
  component layer no longer depends on the browser-layer SKU factory
- Track first-purchase settings open with a boolean instead of
  resetting the delegate; delegate is only dropped in Shutdown()
- Change BraveOriginNavigationDelegate to use raw_ref<Profile>
- Add TODO comment in config.gni for the circular dependency
- Add //brave/browser/skus dep to browser/ui/brave_origin BUILD.gn

* Fix Android linker error for ShowSettingsSubPageForProfile

chrome::ShowSettingsSubPageForProfile is not available on Android.
Guard the call and its include with #if !BUILDFLAG(IS_ANDROID),
matching the pattern used in ai_chat and other Brave features.

* Register kOriginFreeTierAccepted pref in settings handler unit tests on Linux

The three test fixtures in this file manually register prefs but were
missing kOriginFreeTierAccepted, which is registered in production code
via RegisterLocalStatePrefs and read during BraveOriginService
construction on Linux. This caused a CHECK failure on Linux:
"Trying to access an unregistered pref: brave.origin.free_tier_accepted"

* Fix linker errors for BraveOriginNavigationDelegate on Android/tests and iOS constructor mismatch

The brave_origin_navigation.cc implementation was only compiled for
desktop (!is_android) but the factory references it on all platforms.
Move the dep outside the platform guard so it links on Android too, and
add it to the unit_tests target. For iOS, create a BraveOriginDelegateIOS
that wraps the SKU service getter to match the new Delegate-based
constructor signature.
2026-04-14 18:09:51 -04:00
Brian R. Bondy 73d4857336 Add premium account documentation (#35498)
Add premium account information
2026-04-14 14:39:15 -04:00
Brian R. Bondy 28178be892 Fix default browser detection for Origin branded builds (#35465)
* Fix default browser detection for Origin branded builds

The upstream IsAnotherChromeChannel() on macOS compares only the first
3 bundle ID components, causing Brave Origin (com.brave.Browser.origin)
to incorrectly match regular Brave (com.brave.Browser) as "another
channel". This made Origin think it was already the default when regular
Brave was, suppressing the default browser infobar.

On Linux, the check searched for "brave-browser" in xdg-settings output
regardless of brand, so Origin builds matched regular Brave desktop
files as "another channel" too.

* Guard IsRegularBraveBundleId with buildflag to fix unused function error

Wraps IsRegularBraveBundleId in #if !BUILDFLAG(IS_BRAVE_ORIGIN_BRANDED)
since it is only called in the non-Origin branch of IsAnotherBraveChannel,
fixing -Werror,-Wunused-function on Origin-branded macOS builds.
2026-04-14 08:10:50 -04:00
Brian R. Bondy 6d2f9e10af Fix settings search errors in origin-branded builds (#35456)
Fix two errors triggered when typing in settings search:
- Add null check in isPrefManaged_ and move <if expr> to wrap
  the dom-if template so web_discovery_enabled binding doesn't
  evaluate when web discovery is disabled at build time.
- Add searchContents to settings-brave-origin-page so settings
  search can enumerate it without throwing.
2026-04-13 14:13:53 -04:00
Brian R. Bondy 92225f368f Remove accidentally committed docs (#35454) 2026-04-13 08:32:18 -04:00
Brian R. Bondy c72425ff09 [Brave Origin] Set window icon on startup dialog (#35427)
* [Brave Origin] Set window icon on startup dialog

The BraveOriginStartupView did not override any WidgetDelegate icon
methods, causing incorrect icons in taskbars/menus on Linux and macOS.

Override GetWindowAppIcon(), GetWindowIcon(), and ShouldShowWindowIcon()
to return the branded product logo (IDR_PRODUCT_LOGO_128).

* Add chrome_unscaled_resources GN dependency for window icon
2026-04-10 12:51:33 -04:00
Brian R. Bondy c5736c85bb Show restart banner on Brave Origin settings page when dirty (#35307)
* Show restart banner on Brave Origin settings page when dirty

Adds a restart notification bar to the Brave Origin settings page
that appears when policy values have changed since browser startup
or when a first purchase is detected mid-session.

Backend: BraveOriginService snapshots policy values at construction
and exposes NeedsRestart() via a new Mojo GetNeedsRestart() method.
A new kOriginPoliciesWereEnforced pref persists enforcement state
across sessions to reliably detect first-purchase vs existing.

Frontend: Uses Chromium's RelaunchMixin for proper restart handling,
shows a fixed-bottom banner with an Origin-specific message, and
re-checks restart state after every toggle or reset.

* Remove redundant in-class initializer for startup_was_enforcing_

The constructor always sets this from the pref, so the default is
never used.

* Fix rebase: register both kOriginPurchaseValidated and kOriginPoliciesWereEnforced

The rebase conflict resolution incorrectly replaced kOriginPurchaseValidated
with kOriginPoliciesWereEnforced, but these are separate prefs.
SetPurchased() still writes kOriginPurchaseValidated, so both must be
registered in test SetUp.
2026-04-09 22:10:17 -04:00
Brian R. Bondy b9b8d1a388 Fix toolbar-height side panel minimum width for Origin builds (#35398)
In V1 mode, Brave's custom SidePanel class replaces upstream's globally
via chromium_src. This means the toolbar_height_side_panel_ (an upstream
feature) gets Brave's GetMinimumSize() returning kDefaultSidePanelWidth
(400) instead of upstream's kSidePanelDefaultContentWidth (360).

Upstream's CalculateHorizontalLayout checks whether the toolbar-height
side panel fits beside the toolbar: remainder = window_width -
toolbar_min - padding. The test sets window_width = toolbar_min + 400,
giving remainder ~392. With upstream's min of 360, 392 >= 360 passes
and the panel is clamped correctly. With Brave's 400, 392 < 400 forces
the panel into content-height mode where it gets full width unclamped.

On normal Brave builds this was masked: when the sidebar is visible, its
minimum width contribution to the browser's overall GetMinimumSize()
prevents the window from being sized small enough to trigger the issue.
PR #35233 set kShowNever for Origin builds, removing that sidebar
contribution and exposing the incompatible minimum width.

Fix by making GetMinimumSize() type-aware: toolbar-height panels use the
upstream-compatible minimum (360), content-height panels (inside the
sidebar) keep kDefaultSidePanelWidth (400).

Resolves brave/brave-browser#54206
2026-04-09 16:49:43 -04:00
Brian R. Bondy 006cb1b0f3 Fix Brave Origin startup dialog padding and height (#35383)
Simplify container padding to uniform spacing and increase dialog height
to prevent content clipping.
2026-04-08 17:32:30 -04:00
Brian R. Bondy 3e73b47ce0 Hide Web Discovery infobar when managed by admin policy (#35384) 2026-04-08 17:29:38 -04:00
Brian R. Bondy 2d66ca65bc Make policy load on startup without an async delay (#35337)
* Block brave://wallet WebUI on desktop when disabled by policy

Previously, the wallet WebUI on desktop relied solely on
WalletPageUIConfig::IsWebUIEnabled() to prevent loading when wallet is
disabled by policy (e.g. via Brave Origin). Unlike brave://rewards which
has a second check in GetWebUIType(), wallet lacked this, allowing the
page to load and fail with "Mojo is not defined".

Add an IsAllowedForContext check in GetWebUIType() for wallet page and
panel hosts on desktop, matching the rewards blocking pattern.

* Format: fix line wrapping in wallet WebUI block

* Block wallet WebUI when BraveOrigin feature is enabled

The previous IsAllowedForContext check only blocked wallet when the
managed pref was set by admin policy. BraveOrigin policies are only
loaded after purchase verification, so enabling BraveOrigin via feature
flag without purchase left wallet accessible.

Add IsBraveOriginFeatureEnabled() check to GetWebUIType(),
WalletPageUIConfig::IsWebUIEnabled, and
WalletPanelUIConfig::IsWebUIEnabled to block wallet WebUI in all
BraveOrigin configurations.

* Use persisted purchase pref for IsPurchased check

BraveOriginPolicyManager::IsPurchased() only returned true after the
async SKU credential check completed. On startup, this meant policies
weren't applied yet when wallet WebUI tried to load.

Fall back to the kOriginPurchaseValidated local state pref so policies
are applied immediately on startup. Remove BraveOrigin-specific checks
from wallet code — the admin policy pref check is sufficient.
2026-04-08 14:36:56 -04:00
Brian R. Bondy 34a395dde0 Fix Brave Origin sharing taskbar icon with Brave on Linux (#35271)
GetDesktopName() hardcoded brave-browser-*.desktop for all builds,
ignoring the IS_BRAVE_ORIGIN_BRANDED buildflag. This caused the
running binary to report a different .desktop name than the one
installed by the package (brave-origin-*.desktop), making the window
manager group Brave Origin windows with regular Brave in the taskbar.
2026-04-05 10:20:36 -04:00
Brian R. Bondy 15e96444af Hide Brave Origin settings page for branded builds (#35254)
The Origin settings page was showing for both branded builds
(is_brave_origin_branded=true) and upgrade purchases. It should
only show when the user has purchased the Origin upgrade.
2026-04-04 13:36:43 -04:00
Brian R. Bondy 2d48fb7f59 Disable crash reporting by default for Brave Origin (#35253) 2026-04-04 11:54:16 -04:00
Brian R. BondyandClaude Opus 4.6 55bc3c7913 Add Web Discovery build flag (#35252)
* Add Web Discovery build flag

* Remove obsolete kDontAskEnableWebDiscovery pref

This legacy pref was only being registered and immediately cleared
during migration. Remove it entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:07:56 -04:00
Brian R. Bondy b0bc0b0128 Allow scrolling and resizing for the startup dialog (#35232) 2026-04-02 21:05:22 -04:00
Brian R. Bondy 7e13d4c4c0 Disable sidebar by default for Brave Origin branded builds (#35233) 2026-04-02 21:04:54 -04:00
Brian R. Bondy 61a5dc5bc0 Add disable-model-invocation to all Claude Code skills (#35224)
Add disable-model-invocation: true to all skills

Skills are always loaded at session start, consuming context tokens
even when not invoked. Setting disable-model-invocation: true makes
them lazy-loaded, only entering context when explicitly invoked via
slash command.
2026-04-02 16:28:21 -04:00
Brian R. Bondy bb8e455038 Clarify best practice applicability and reduce upstream hallucinations (#35219)
* Clarify best practice applicability and reduce upstream hallucinations

- ARCH-020: Clarify rule applies to bypassing access control, not
  normal inheritance patterns (calling protected methods from subclasses)
- ARCH-062: Clarify CUJ test requirement applies to UI features, not
  backend services or infrastructure
- Review rules: Add explicit instruction to verify upstream code claims
  by reading actual files rather than relying on training data

* Update ARCH-020 friend class example to modern #define pattern

Replace outdated BRAVE_CLASS_NAME_H guidance with the current
chromium_src #define approach for adding friend declarations.
2026-04-02 13:36:07 -04:00
Brian R. Bondy 6cc4baf927 Fix upgrade case to show purchase UI in System settings, fix sidebar refresh, and crashes (#35173)
* Fix upgrade case to show purchase UI in System settings

* Guard NTP and rewards BindInterface against null services

When admin or BraveOrigin policies disable rewards or AI chat,
the service factories return null. The NTP was CHECKing these
non-null and crashing on startup. Guard all affected
BindInterface methods with null checks. Also always register
wallet mojo binders so the renderer is not killed when wallet
is disabled by policy.

* Hide NTP Leo chat input when AI chat is disabled by policy

* Refresh sidebar items when policy prefs change

When BraveOrigin policies disable features like AI chat, wallet,
or Brave Talk, the sidebar needs to remove the corresponding
built-in items. Watch the relevant policy prefs and re-evaluate
built-in item visibility when they change.
2026-04-02 12:42:57 -04:00
Brian R. Bondy 4004ae199e Revert "Revert "Fix Brave Origin Windows build using wrong icons"" (#35157)
* Revert "Revert "Fix Brave Origin Windows build using wrong icons" (#35156)"

This reverts commit 4d5809d130.

* Add missing icons
2026-04-02 08:13:30 -04:00
Brian R. Bondy 4d5809d130 Revert "Fix Brave Origin Windows build using wrong icons" (#35156)
Revert "Fix Brave Origin Windows build using wrong icons (#35081)"

This reverts commit 49519b3a35.
2026-04-01 09:39:16 -04:00
Brian R. Bondy 49519b3a35 Fix Brave Origin Windows build using wrong icons (#35081)
brave_exe.rc hardcoded theme\brave\win\ icon paths for all builds.
Use a BRAVE_ICON macro that switches between theme\brave\win and
theme\brave_origin\win based on IS_BRAVE_ORIGIN_BRANDED define.
2026-04-01 07:46:55 -04:00
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 5c5eac47b7 Skip uplift reviews (#34997) 2026-03-25 16:40:53 -04:00
Brian R. Bondy af0874f97f Update Brave Origin Linux package descriptions (#34998) 2026-03-25 16:40:37 -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. BondyandFrancois Marier 581039ac87 Use origin-branded names for packages and dist artifacts (#34939)
* Use origin-branded names for Linux packages and dist artifacts

When is_brave_origin_branded=true, use brave-origin instead of
brave-browser for DEB/RPM package names and brave-origin instead
of brave for Linux symbols zip filenames.

- Add brave-origin/chromium-browser.info and appdata.xml.template
- Add brave_dist_name and brave_linux_package_name to config.gni
- Use brave_linux_package_name in Linux installer patch
- Conditionally select branding directory in sources.gni

* Use origin-branded dist name for all platform artifacts

Use brave_dist_name for dist zips, symbols, and native symbols
on all platforms. For origin builds this renames artifacts from
brave-v* to brave-origin-v* on Windows, Mac, and Android.

* Update chromium_src/chrome/installer/linux/common/brave-origin/appdata.xml.template

Co-authored-by: Francois Marier <francois@brave.com>

* Apply suggestion from @fmarier

Co-authored-by: Francois Marier <francois@brave.com>

* Use separate install dirs for origin to allow coexistence

Use /opt/brave.com/brave-origin and /etc/brave-origin for origin
builds so that regular Brave and Brave Origin can be installed
side by side on the same machine.

* Use origin screenshot URL in appdata template

* Match project_license with brave-browser appdata template

* Use distinct PROGNAME for origin to avoid conflicts with brave-browser

* Use brave-origin as binary name on Linux for origin builds

* Revert brave_exe and PROGNAME changes for origin

PROGNAME must match the actual binary name (brave) since the
wrapper script uses it to exec the binary. Coexistence between
brave-browser and brave-origin is handled by distinct PACKAGE,
INSTALLDIR, and ENROLLMENTDIR values, not the binary name.

---------

Co-authored-by: Francois Marier <francois@brave.com>
2026-03-25 10:56:13 -04:00
Brian R. BondyandClaude Opus 4.6 a7bade6bac Fix Origin branding strings showing "Brave Nightly" on Windows (#34870)
* Fix Origin branding strings showing "Brave Nightly" on Windows

The brave_origin_strings.grd file had identical strings to
brave_strings.grd, causing Origin builds to display "Brave Nightly"
instead of "Brave Origin Nightly" on Windows. Update all user-facing
product name strings to use "Brave Origin" branding across Windows
shortcut names, accessible window titles, Start Menu folders, firewall
rules, and Mac helper names.

* Generate Origin branding via chromium-rebase-l10n.py

Update the python rebase script to apply "Brave Origin" branding
to brave_origin_strings.grd after it is copied from brave_strings.grd,
so the changes survive future l10n rebases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Only apply Origin branding to non-translatable strings

Remove translatable strings from the Origin branding list to avoid
breaking XTB fingerprint matching. Only strings with
translateable="false" or with their translateable attribute stripped
by the brave_strings processing are modified.

* Also update XTB fingerprints for Origin-branded strings

Apply Origin branding to all user-visible strings (not just
translateable=false) and update XTB files with new fingerprints
and "Brave Origin" text in translations.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:02:07 -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
Brian R. Bondy caa92cf07f Skip violations in surrounding unchanged code during reviews (#34894) 2026-03-23 11:12:13 -04:00
Brian R. Bondy 54d0a15d3a Add best practice: keep PRs focused on a single purpose (#34891) 2026-03-23 11:11:47 -04: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
Brian R. Bondy 358d226476 Get closer to Brave Origin startup styling (#34739) 2026-03-19 17:08:50 -04:00
Brian R. Bondy deafb8cca8 Use a different bg image for Brave Origin dmg (#34740) 2026-03-19 10:02:16 -04:00
Brian R. Bondy 1b75c1f19f Remove Profiles menu while Brave Origin startup dialog is swhown (#34699) 2026-03-18 20:43:18 -04:00
Brian R. Bondy a2771982cb Move review-prs skill to brave-core (#34703)
* Copy review-prs skill and dependencies from brave-dev-bot

Raw copy of the review-prs skill files and their dependency scripts
(check-can-approve, resolve-bot-threads, extract-pr-images, load_config)
from brave-dev-bot. Paths still reference the bot directory structure
and will be fixed in the next commit.

* Fix paths for review-prs skill in brave-core repo

- Replace load_config with hardcoded brave-core config values
- Update all _BOT_DIR references to _REPO_DIR (brave repo root)
- Point best practices docs to docs/best-practices/ in repo
- Point manage-bp-ids.py to script/manage-bp-ids.py in repo
- Move dependency script paths to .claude/skills/review-prs/scripts/
- Store cache files under .claude/.ignore/ instead of bot .ignore/
- Remove Signal notification support (bot-specific)
- Update SKILL.md to use SKILL_DIR instead of BOT_DIR

* [review-prs] Add date context, rule links, and batch dedup

- Include current UTC date in subagent prompts to prevent false
  copyright year flags
- Embed rule_link as clickable markdown in posted comments
- Deduplicate cross-chunk violations before prioritization

* Add nosemgrep suppression for urllib.request.urlopen

The https:// scheme check on line 180 prevents file:// SSRF, but
opengrep doesn't recognize the nosec directive — add nosemgrep.

* Revert nosemgrep addition — reviewdog ignores inline suppressions

* Remove ineffective nosec B310 comment from urlopen call

* Address review: harden URL redirect and input validation
2026-03-17 09:14:15 -04:00
Brian R. Bondy 7ceb66df03 Add Linux-specific free tier to Origin startup dialog (#34721)
On Linux (and macOS for testing), the startup dialog shows
a different view that allows users to proceed without a
purchase. Adds ProceedFree Mojo method, platform-gated
isLinuxFreeEligible flag, and new localized strings.
2026-03-17 09:13:25 -04: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. BondyandMichael Herrmann 07d5187ec3 Fix Brave Origin macOS DMG layout (#34710)
* Add Origin-specific DS_Store files for macOS DMG layout

* Update build/mac/ds_store/update_ds_store_files.py

Co-authored-by: Michael Herrmann <michael@herrmann.io>

* Update build/mac/BUILD.gn

Co-authored-by: Michael Herrmann <michael@herrmann.io>

* Fix missing closing quote in update_ds_store_files.py

---------

Co-authored-by: Michael Herrmann <michael@herrmann.io>
2026-03-13 17:05:30 -04:00
Brian R. Bondy a8214ba5c9 Wire up BraveOrigin startup dialog to browser launch (#34555)
* Add BraveOrigin startup dialog view

Adds BraveOriginStartupView, a standalone modal window that hosts
the startup WebUI dialog. Manages system profile creation, web
contents lifecycle, and buy window navigation.

* Address review feedback for BraveOrigin startup view

- Use WidgetDelegate instead of deprecated WidgetDelegateView
- Use WebView(profile) + LoadInitialURL instead of manual WebContents
- Remove redundant GetAccessibleWindowTitle/CalculatePreferredSize overrides
- Simplify SetTitle to use message ID directly
- Fix g_startup_view leak with unique_ptr + cleanup in WindowClosing
- Remove chromium_src WidgetDelegateView friend class override

* Wire up BraveOrigin startup dialog to browser launch

Intercepts StartupBrowserCreator::Start to show the purchase
validation dialog before any browser window opens. Blocks Mac
app commands while the dialog is showing.

* Address review feedback and add test coverage for startup view

Refactor BraveOriginStartupView to use a Delegate interface instead of
raw callbacks, making the code more testable and readable. Move the
--test-type guard into ShouldShowDialog() and add
SetShouldShowDialogForTesting() for browser test support. Use
__VA_ARGS__ in the startup_browser_creator.h macros. Add unit tests
covering ShouldShowDialog with various pref/SKU credential states.

* Add browser tests for BraveOrigin startup dialog

* Add integration tests for StartupBrowserCreator::Start override

Exercise the real startup interception logic that shows the
BraveOrigin dialog, covering both validation and close paths.
2026-03-13 08:25:32 -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
Brian R. Bondy 8ceb5f27c7 Add best practice skill: order entries by ID (#34698) 2026-03-12 20:05:49 -04:00
Brian R. Bondy 0d676b6bbe Add Brave as a browser import source for Brave Origin (#34650)
Add Brave as a browser import source

Allow users to import data from another Brave browser installation.
2026-03-12 14:57:34 -04:00
Brian R. Bondy 4bf5532630 Add BraveOrigin startup dialog view (#34554)
* Add BraveOrigin startup dialog view

Adds BraveOriginStartupView, a standalone modal window that hosts
the startup WebUI dialog. Manages system profile creation, web
contents lifecycle, and buy window navigation.

* Address review feedback for BraveOrigin startup view

- Use WidgetDelegate instead of deprecated WidgetDelegateView
- Use WebView(profile) + LoadInitialURL instead of manual WebContents
- Remove redundant GetAccessibleWindowTitle/CalculatePreferredSize overrides
- Simplify SetTitle to use message ID directly
- Fix g_startup_view leak with unique_ptr + cleanup in WindowClosing
- Remove chromium_src WidgetDelegateView friend class override
2026-03-12 11:13:50 -04:00
Brian R. Bondy d015da0e0f Compile out P3A infobar and disable P3A by default for Brave Origin builds (#34612)
The P3A infobar was showing on Brave Origin branded builds even though
P3A should be disabled. This compiles out the infobar code entirely
for branded builds and sets the P3A pref defaults to off.
2026-03-10 20:35:53 -04:00
Brian R. Bondy c6a040c9f6 Remove CODEOWNER rule that matches nothing (#34606) 2026-03-10 16:24:33 -04:00
Brian R. Bondy eda7296dab Remove components/constants CODEOWNERS since brave-dev-bot warns abou… (#34605)
Remove components/constants CODEOWNERS since brave-dev-bot warns about it now
2026-03-10 14:28:52 -04:00
Brian R. Bondy 7c78493998 Add BraveOrigin startup dialog mojo, WebUI, frontend, and tests (#34553)
Adds the mojo interface, WebUI handler + UI classes, frontend
resources (HTML/CSS/TS), storybook stories, string resources,
and unit tests for the Brave Origin startup purchase dialog.
2026-03-10 12:48:37 -04:00
Brian R. Bondy 391da523ab Add Claude skills documentation (#34603) 2026-03-10 10:53:54 -04:00
Brian R. Bondy af22939d2e Import Claude Code skills and helper scripts (#34569)
* Import best-practice docs from brave-experiments/brave-core-tools

* Add Claude Code skills and helper scripts

Skills for: code review, CI management,
branch management, crash analysis, upstream flake detection, PR
creation, preflight checks, and more.
2026-03-09 21:15:46 -04:00
Brian R. Bondy e7235b16de Skip CheckLongLines for web files formatted by prettier (#34584) 2026-03-09 21:14:15 -04: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 R. Bondy 1cbc3afe9a Narrow DEPS codeowners to root and chromium_src only (#34376)
Other DEPS files are covered by netzenbot's automated checks
and gn check. Root DEPS is a code execution channel on checkout
and chromium_src DEPS can't be validated by gn check, so those
still need manual review.
2026-03-02 16:36:04 -05:00
Brian R. Bondy e886177073 Remove CODEOWNERS rules for Brave Account (#34372)
Remove land-grab CODEOWNERS rules for Brave Account

The *brave_account* and *BraveAccount* wildcard rules match any file
path containing those strings, which is overly broad and triggers
unnecessary reviews. This is a "land-grab" pattern that taxes
productivity for developers who trigger those reviews.
2026-03-02 16:02:38 -05:00
Brian R. Bondy d6db5f12d7 Remove dead CODEOWNERS rules (#34371)
Remove dead CODEOWNERS rules for deleted files

- script/build-bisect.py: file was removed
- browser/ui/webui/brave_web_uicontroller_factory.cc: file was removed
- browser/ui/webui/brave_rewards_page_ui.{cc,h}: files were removed
- browser/ui/webui/brave_rewards_ui.{cc,h}: files were removed
- third_party/boost: directory was removed
- brave/components/l10n/: wrong path prefix (brave/) so it never
  matched anything, and the component is deprecated anyway
2026-03-02 16:02:22 -05:00
Brian R. Bondy 20fd971d87 Add contributor guidelines for PR volume and AI-assisted contributions (#34346) 2026-03-01 18:05:43 -05:00
Brian R. Bondy 693b54c1d7 Remove arch from daily usage ping (#34277)
* Remove arch from daily usage ping

* Fix formatting

* Fix GN check and DEPS for brave_stats_updater_util include
2026-02-28 19:22:47 -05:00
Brian R. Bondy 9be34f4a6d Move time_period_storage unit tests to brave_components_unittests (#34133) 2026-02-25 09:10:18 -05:00
Brian R. Bondy 6c4d84a58b Move assist_ranker unit tests to brave_components_unittests (#34128) 2026-02-24 20:18:28 -05:00
Brian R. Bondy 034e05e626 Move brave_private_cdn unit tests to brave_components_unittests (#34130) 2026-02-24 20:18:08 -05:00
Brian R. Bondy eb8b247c12 Move brave_sync crypto unit test to brave_components_unittests (#34132) 2026-02-24 20:17:55 -05:00
Brian R. Bondy 4c01567ce4 Move ntp_background_images unit tests to brave_components_unittests (#34134)
Also fix incorrect !is_ios guards on production sources and tests
that don't actually depend on content, and replace
content::BrowserTaskEnvironment with base::test::TaskEnvironment
in view_counter_model_unittest.cc.
2026-02-24 20:16:51 -05:00
Brian R. Bondy f086800037 Make Origin upgrade case free for Linux users (#34115)
* Make Origin upgrade case free for Linux users

This still requires the feature flag to be passed

* Address review: use ASSERT_FALSE for precondition check

Change EXPECT_FALSE to ASSERT_FALSE for the IsPurchased() precondition
in CheckPurchaseState_Linux_AlwaysReturnsPurchased, since subsequent
assertions depend on this being false.
2026-02-24 00:51:09 -05:00
Brian R. Bondy 32e89c0aa0 Force BraveOriginService enabled for Brave Origin branded builds (#33258)
Everything else will be compiled out, but this re-uses the
BraveOriginService to keep things in sync and relies on it for these
things:

- P3A → off
- Web Discovery → off
- Stats reporting → off

This is safest for the future too that it uses it.
2026-02-23 19:04:13 -05:00
Brian R. Bondy 5b613d6e35 Remove official build guard origin policy (#34096)
* Remove OFFICIAL_BUILD guard and add SKU purchase state to Origin policy

IsBraveOriginEnabled() now checks both the feature flag and purchase
state from BraveOriginPolicyManager, replacing the #if !defined
(OFFICIAL_BUILD) compile-time guard with a runtime check.

* Use BraveOriginPolicyManager as single source of truth for purchase state

Remove duplicate is_purchased_ field from BraveOriginService and delegate
to BraveOriginPolicyManager. OnCredentialSummary now calls
SetPurchased() on the policy manager, wiring SKU purchase detection to
the policy system so IsBraveOriginEnabled() returns the correct value.
2026-02-23 13:27:49 -05:00
Brian R. Bondy 6e1112330a Brave origin add purchase state for upgrade case (#34044)
* Add SKU purchase state check to Origin settings

Integrate SKUs service to verify purchase state before showing
the Origin settings page. Shows onboarding view for unpurchased
users and re-checks on tab visibility change.

* Use TetFuture instead of RunLoop

* Move FakeSkusService to skus/browser:test_support target

Makes the fake reusable by any component that depends on the SKU
service, not just brave_origin tests.

* Convert remaining RunLoop to TestFuture
2026-02-20 10:50:58 -05:00
Brian R. Bondy 0ee7b3846d Disable web discovery native for Origin branded builds (#33816)
* Disable web discovery native for Origin branded builds

* Move non-web-discovery deps back to common deps in browser_tests

//net:test_support and //services/service_manager/public/cpp are not
web-discovery-specific and should not be gated behind the
enable_web_discovery_native flag.
2026-02-12 07:36:42 -05:00
Brian R. Bondy abd5e9f7cc Use brave_domains for Origin buy URL instead of hardcoding (#33838) 2026-02-11 12:36:35 -05:00
Brian R. Bondy f23676687a Assert that Brave Origin branding is desktop-only (#33846)
Add build assertions to fail early if is_brave_origin_branded is
enabled on Android or iOS, since it is only supported on desktop
platforms.
2026-02-11 07:42:29 -05:00
Brian R. Bondy 907a7c60fa Add missing buildflag guards to Origin settings page (#33812)
Only Speedreader had an <if expr> guard. Add guards for all
feature toggles so they don't render when compiled out.

Resolves https://github.com/brave/brave-browser/issues/52687
2026-02-10 13:00:13 -05:00
Brian R. BondyandMichael Herrmann f92f3ae680 Configure unique GUIDs, installer names, and update paths for Brave Origin (#33184)
* Configure unique GUIDs, installer names, and update paths for Brave Origin

* Fix buildflag_header template to support invoker's public_deps

Chromium Issue number: 7486518 (https://chromium-review.googlesource.com/7486518)

The template was forwarding public_deps from the invoker via
forward_variables_from(), but then unconditionally assigning to it.
This is incompatible - you can't forward a variable and also directly
assign to it.

The fix removes public_deps from forward_variables_from and explicitly
checks for invoker.public_deps after initializing the required
//build:buildflag_header_h dependency.

* Update signing helper to support Origin

With Sparkle (what we currently use):
- Lives in each app bundle separately (Brave and Brave Origin separate)
- There is no priviledged helper in use
- SMAuthorizedClients is not used

With Omaha v4 (not yet in use):
The privileged helper is part of the browser app bundle and not the updater.
The privileged helper is the thing that contains the SMAuthorizedClients value.
The privileged helper gets copied to /Library/PrivilegedHelperTools/<helper name>
The Brave updater is BraveUpdater.app and is the same for both products.

When the browser first runs (or during installation), it registers itself with the updater and the updater installs itself to a shared location like
- /Library/Application Support/BraveSoftware/BraveUpdater/ (system)
- ~/Library/Application Support/BraveSoftware/BraveUpdater/ (user)

Each app register with the updater with its own unique app guid (build/config.gni changes in my pr)
The updater maintains a list of registered apps and checks for updates for each.
Uninstalling one product doesn't remove the updater - it still serves the other.

* Use Origin Sparkle feed URL for Brave Origin builds

* Fix branding files for Origin to not have Browser in the name

This also fixes the wrong info for the Release channel.

* Fix wrong number of strings error because of Origin missing Dev channel

 ../../chrome/installer/util/l10n_string_util.cc(200,3): error: static assertion failed due to requirement 'std::size(kIDS_APP_SHORTCUTS_SUBDIR_NAME_BASEStrings) ==
13:52:59  install_static::NUM_INSTALL_MODES': resource IDS_APP_SHORTCUTS_SUBDIR_NAME_BASE has the wrong number of mode-specific strings.
13:52:59    200 |   DO_MODE_STRINGS
13:52:59        |   ^~~~~~~~~~~~~~~

* Adjust product path names for Brave Origin

* Update chromium_src/chrome/browser/component_updater/updater_state_win.cc

Co-authored-by: Michael Herrmann <michael@herrmann.io>

* Update chromium_src/chrome/installer/util/google_update_constants.cc

Co-authored-by: Michael Herrmann <michael@herrmann.io>

* Update browser/mac/sparkle_glue.mm

Co-authored-by: Michael Herrmann <michael@herrmann.io>

* Review fixes

---------

Co-authored-by: Michael Herrmann <michael@herrmann.io>
2026-01-29 13:13:05 -05:00
Brian R. Bondy 139d44583b Fix Windows build when enable_brave_vpn is false and create_dist (#33372)
* Fix Windows build when enable_brave_vpn is false

When VPN is disabled (e.g. Origin builds), copy chrome's resource
allowlist instead of trying to merge with wireguard resources.

* create_dist Origin fixes
2026-01-23 10:29:27 -05:00
Brian R. Bondy a806704585 Intermittent fail fix for AIChatUIPageHandlerBrowserTest.ProcessImageFile (#33360) 2026-01-22 10:45:18 -05:00
Brian R. Bondy 8cba0357eb Fix linking on Windows for Origin builds (#33347) 2026-01-21 17:30:04 -05:00
Brian R. Bondy 03fb5d327d Split out pref and feature Brave Origin targets (#33322)
Add Brave Origin targets for features and prefs
2026-01-21 15:39:10 -05:00
Brian R. Bondy 55db41dced Brave Origin purchase option in system settings (#33325) 2026-01-21 13:34:48 -05:00
Brian R. Bondy 638f571834 Fix Tor intermittent failures (#33301)
* Use universal binary for Tor tests

The test data binary at brave/test/data/tor/components/mac/cldoidikboihgcjfkhdeidbpclkineef/1.0.0/tor-0.3.3.8-darwin-brave-5 is x86_64 only.
But the component is a universal binary: cldoidikboihgcjfkhdeidbpclkineef
Tor tests BraveTorBrowserTest and BraveTorWithCustomProfileBrowserTest are failing with EBADARCH.

* Ensure component cleanup finishes before test exits

When PRE_ResetBridges sets bridges to not used, it triggers cleanup of the pluggable transport component. The test was only waiting for the snowflake process to exit (WaitProcessExit), but the component cleanup happens asynchronously on a separate thread
2026-01-21 10:05:53 -05:00
Brian R. Bondy f1b31634cd Fix Brave Origin Settings Handler file path (#33321) 2026-01-20 19:09:12 -05:00
Brian R. Bondy 13bf5e3a82 Modify onboarding for Brave Origin (#33257)
Skip WDP onboarding step and modify last step
2026-01-20 13:20:51 -05:00
Brian R. Bondy 94e064b2a7 Get rid of BraveOrigin mojo common dir (#33277) 2026-01-20 13:18:27 -05:00
Brian R. Bondy af374e6aab Fix Brave Origin win installer brand rc generation (#33279) 2026-01-19 16:35:49 -05:00
Brian R. Bondy 3c76bb88a9 Brave Origin Strings XTB handling (#33261)
* Script changes to copy XTB files for Brave Origin

This is done when rebasing Chromium with `npm run chromium_rebase_l10n`

* Update GRD file to use Brave Origin's own XTB files

* Lint fix
2026-01-19 12:40:47 -05:00
Brian R. Bondy 326c6ed16f Update welcome page branding (#33245) 2026-01-16 11:36:31 -05:00