Chromium Code Reviews| Index: chrome/browser/resources/md_policy/policy_group.js |
| diff --git a/chrome/browser/resources/md_policy/policy_group.js b/chrome/browser/resources/md_policy/policy_group.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..82c72c92230e1c812eb2c3a4a4640af2af3407cb |
| --- /dev/null |
| +++ b/chrome/browser/resources/md_policy/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 |
| + * '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: |
| + * |
| + * <policy-group risk-tag="Privacy and Security"></policy-group> |
| + * |
| + * would render a paper card with the title 'Privacy and Security'. |
| + * New Policies are added with |addPolicy|. |
| + * |
| + * @group Chrome Policy Elements |
| + * @element policy-group |
| + */ |
| + |
| +PolicyGroup = Polymer({ |
| + is: 'policy-group', |
| + |
| + /** |
| + * @override |
| + * @param {string} riskTag String ID used as title for the group card. |
| + */ |
| + factoryImpl: function(riskTag) { |
| + /** @type {string} */ |
|
stevenjb
2015/10/08 17:12:39
What I meant to suggest here was to declare this a
fhorschig
2015/10/09 11:57:31
Done.
|
| + this.riskTag = riskTag; |
| + }, |
| + |
| + /** |
| + * Creates a new DOM element for the given policy. |
| + * @param {string} policy Name of the policy. |
| + */ |
| + 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); |
| + }, |
| +}); |