Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Unified Diff: ui/webui/resources/cr_elements/policy/README.md

Issue 2696903005: Move common cr-policy-indicator behavior into CrPolicyIndicatorBehavior (Closed)
Patch Set: TODO and README update Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/webui/resources/cr_elements/policy/README.md
diff --git a/ui/webui/resources/cr_elements/policy/README.md b/ui/webui/resources/cr_elements/policy/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..4e54f3d520c75e0f0604539b29ec3f7e0feeb492
--- /dev/null
+++ b/ui/webui/resources/cr_elements/policy/README.md
@@ -0,0 +1,41 @@
+# Policy indicators
+
+Setting that can't be controlled by the current user often show an icon and a
dschuyler 2017/02/28 22:16:33 maybe s/Setting/Settings/ or s/Setting/A setting
michaelpg 2017/03/01 00:34:00 Done.
+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, assuming
+`CrPolicyStrings` is defined.
dschuyler 2017/02/28 22:16:33 maybe s/assuming/assuming an entry in/ (since CrPo
michaelpg 2017/03/01 00:34:00 No, the actual object needs to be defined -- we do
+
+## Using an indicator
+
+Elements like `<cr-policy-pref-indicator>` and `<cr-policy-network-indicator>`
+are provided to be reused in WebUI pages:
+
+ <cr-policy-pref-indicator pref="[[pref]]"></cr-policy-pref-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`.
+
+
+[cr_elements/icons.html]: ../icons.html
+[settings-checkbox]: /chrome/browser/resources/settings/controls/settings_checkbox.html
+[cr_policy_pref_indicator.js]: cr_policy_pref_indicator.js
+[cr_policy_pref_indicator.html]: cr_policy_pref_indicator.html
« no previous file with comments | « chrome/test/data/webui/settings/date_time_page_tests.js ('k') | ui/webui/resources/cr_elements/policy/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698