Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @fileoverview | |
| 7 * 'policy-group' is an MD element, that contains a description of a group | |
| 8 * and all policies that are tagged with the groups name. Policies with multiple | |
| 9 * tags will appear in multiple groups. | |
| 10 * | |
| 11 * Example: | |
| 12 * | |
| 13 * <policy-group risk-tag="Privacy and Security"></policy-group> | |
| 14 * | |
| 15 * would render a paper card with the title 'Privacy and Security'. | |
| 16 * New Policies are added with |addPolicy|. | |
| 17 * | |
| 18 * @group Chrome Policy Elements | |
| 19 * @element policy-group | |
| 20 */ | |
| 21 | |
| 22 PolicyGroup = Polymer({ | |
| 23 is: 'policy-group', | |
| 24 | |
| 25 /** @override */ | |
| 26 factoryImpl: function(riskTag) { | |
|
stevenjb
2015/10/07 17:09:32
@param for riskTag
Also, declare (and type) riskTa
fhorschig
2015/10/08 09:35:45
Done.
| |
| 27 this.riskTag = riskTag; | |
| 28 }, | |
| 29 | |
| 30 /** | |
| 31 * Creates a new DOM element for the given policy. | |
| 32 * @param {string} policy Name of the policy. | |
| 33 */ | |
| 34 addPolicy: function(policy) { | |
| 35 // TODO(fhorschig): Create policy paper-items with possibility to (un)fold. | |
| 36 var node = document.createElement('p'); | |
| 37 node.textContent = policy; | |
| 38 this.$.content.appendChild(node); | |
| 39 }, | |
| 40 }); | |
| OLD | NEW |