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-on: https://chromium-review.googlesource.com/c/chromium/src/+/3648387
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Owen Min <zmin@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007557}
NOKEYCHECK=True
GitOrigin-RevId: 952de22b560e4b6dac56d560c51685086ac572a0
9 files changed