chrome://policy: Remove use of deprecated cr/ui.m.js

Migrate to Web Components, instead of the outdated cr.ui.define() and
related methods.

Since this UI is also served on iOS, this CL ports the
ShouldReplaceI18nInJS/EnableReplaceI18nInJS methods from Desktop to
iOS. This is done to enable Web Components to work on iOS, since the
HTML for custom elements, including $i18n{} expressions, is inlined in
the JS file that is served at runtime.

Bug: 1322977
Change-Id: Ide884bde405709c73cde9312ebc7da1e1bad8b18
Reviewed-by: Mike Dougherty <>
Reviewed-by: Demetrios Papadopoulos <>
Reviewed-by: Erik Chen <>
Reviewed-by: Owen Min <>
Reviewed-by: Ted Choc <>
Commit-Queue: Rebekah Potter <>
Cr-Commit-Position: refs/heads/main@{#1007557}
GitOrigin-RevId: 952de22b560e4b6dac56d560c51685086ac572a0
9 files changed