Files
brave-core/components/brave_policy
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
..

There are 2 types of policy providers.

  • BraveBrowserPolicyProvider: There is only one of these providers and it manages policies that are stored globally in local state.
  • BraveProfilePolicyProvider: There is one of these providers per profile and it manages policies that are stored in profile prefs.

Policies are defined in components/policy/resources/templates/policy_definitions/BraveSoftware/ and the YAML file has a per_profile attribute which associates it accordingly to the browser or profile provider. Both of these providers will be used for Brave Origin, but also for other work within Brave.