* 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.
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.