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

Unified Diff: chrome/browser/resources/md_policy/cr_policy_group.js

Issue 1371073003: Display material design policies grouped by tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning and Refactoring. Created 5 years, 2 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: chrome/browser/resources/md_policy/cr_policy_group.js
diff --git a/chrome/browser/resources/md_policy/cr_policy_group.js b/chrome/browser/resources/md_policy/cr_policy_group.js
new file mode 100644
index 0000000000000000000000000000000000000000..87b23375609aeadbe96586a640a939ea7d0cb4b5
--- /dev/null
+++ b/chrome/browser/resources/md_policy/cr_policy_group.js
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview
+ * 'cr-policy-group' is an MD element, that contains a description of a group
+ * and all policies that are tagged with the groups name. Policies with multiple
+ * tags will appear in multiple groups.
+ *
+ * Example:
+ *
+ * <cr-policy-group></cr-policy-group>
+ *
+ * By inserting an element as created with
+ *
+ * new CrPolicyGroup('Privacy and Security')
+ *
+ * into a document's DOM would render a paper card with the title 'Privacy and
+ * Security'. New Policies are added with |addPolicy|.
+ *
+ * @group Chrome Policy Elements
+ * @element cr-policy-group
+ */
+
+CrPolicyGroup = Polymer({
+ is: 'cr-policy-group',
+
+ /** @override */
+ factoryImpl: function(riskTag) {
+ this.riskTag = riskTag;
+ },
+
+ /**
+ * Creates a new DOM element for the given policy.
+ * @param {string} tag Name of the policy.
stevenjb 2015/10/06 22:42:03 s/tag/policy/
fhorschig 2015/10/07 16:37:11 Done.
+ */
+ addPolicy: function(policy) {
+ // TODO(fhorschig): Create policy paper-items with possibility to (un)fold.
+ var node = document.createElement('p');
+ node.textContent = policy;
+ this.$.content.appendChild(node);
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698