tree: e161b59a2092cd36997cbeee969aee2f9acd6bea [path history] [tgz]
  1. BUILD.gn
  2. cr_policy_indicator.html
  3. cr_policy_indicator.js
  4. cr_policy_indicator_behavior.html
  5. cr_policy_indicator_behavior.js
  6. cr_policy_network_behavior_mojo.html
  7. cr_policy_network_behavior_mojo.js
  8. cr_policy_network_indicator_mojo.html
  9. cr_policy_network_indicator_mojo.js
  10. cr_policy_pref_behavior.html
  11. cr_policy_pref_behavior.js
  12. cr_policy_pref_indicator.html
  13. cr_policy_pref_indicator.js
  14. cr_tooltip_icon.html
  15. cr_tooltip_icon.js
  16. README.md
ui/webui/resources/cr_elements/policy/README.md

Policy indicators

Settings that can't be controlled by the current user often show an icon and a tooltip explaining why. This happens when a setting is:

  • enforced by user policy, or different from a policy's “recommended” value
  • overridden by an extension
  • or (on Chrome OS):
    • enforced/recommended by device policy (for enrolled devices)
    • set by the device owner (for non-enrolled devices)
    • controlled by the primary user (for multiple profile sessions)

Indicator UI

The badge icons are sourced from cr_elements/icons.html by default.

Indicators show a tooltip with explanatory text on hover if CrPolicyStrings is set; see settings_ui.js for an example from MD Settings.

Using an indicator

Elements like <cr-policy-indicator> and <cr-policy-pref-indicator> are provided to be reused in WebUI pages:

<cr-policy-indicator indicator-type="userPolicy"></cr-policy-indicator>

Example: settings-checkbox.

For one-off or composed elements, CrPolicyIndicatorBehavior provides some configurable properties and calculates dependent properties, such as the tooltip, icon, and visibility of the indicator.

Example: cr_policy_pref_indicator.js overrides indicatorType and indicatorTooltip. cr_policy_pref_indicator.html displays the computed properties from CrPolicyIndicatorBehavior.