* Gate Playlist UI on BravePlaylistEnabled policy
Complements #35732, which hides Playlist via the enable_playlist buildflag
in is_brave_origin_branded=true builds, by also hiding the Playlist UI in
is_brave_origin_branded=false builds when an administrator disables it
via the BravePlaylistEnabled policy (kPlaylistEnabledPref managed=false).
Adds playlist::IsPlaylistEnabled(prefs) / IsDisabledByPolicy(prefs)
helpers alongside existing features.h / pref_names.h, mirroring the iOS
PrefService.isPlaylistAvailable check and the ai_chat::IsAIChatEnabled
pattern. The helper is used to gate the sidebar item, side panel
coordinator and entry, browser action, playlist command, tab helper,
page action icon, and the chrome-untrusted://playlist WebUI.
The SidebarService now observes kPlaylistEnabledPref so the item appears
and disappears when policy changes at runtime.
User-driven pref toggles from settings keep their existing behaviour
(UI stays reachable so the user can flip the pref back); only a managed
pref forced off hides the UI.
Fixesbrave/brave-browser#50156
* Address review: move IsPlaylistAllowed out of common, simplify settings bools
- Relocate playlist::IsPlaylistEnabled from components/playlist/core/common
(which is reachable from any process) to a new components/playlist/core/browser
target, since the helper depends on PrefService (browser-only). Rename the
function to IsPlaylistAllowed to match its semantics (feature flag is enabled
and the pref is not policy-disabled), matching bridiver's suggestion that
"allowed" = managed+feature, "enabled" = user toggle.
- Update all callers and BUILD/DEPS wiring for the new location.
- In brave_settings_ui.cc, stop combining the feature flag and the user pref
into a single isPlaylistAllowed loadTimeData bool. Instead expose
isPlaylistFeatureEnabled and isPlaylistDisabledByPolicy (the Tor pattern),
and let settings page code consult the pref directly via the prefs mixin
when it needs the managed state. page_visibility.ts now computes playlist
visibility from the two building blocks.