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

Side by Side Diff: chrome/browser/resources/md_policy/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: Closure Annotations. 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 unified diff | Download patch
OLDNEW
(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 /**
26 * @override
27 * @param {string} riskTag String ID used as title for the group card.
28 */
29 factoryImpl: function(riskTag) {
30 /** @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.
31 this.riskTag = riskTag;
32 },
33
34 /**
35 * Creates a new DOM element for the given policy.
36 * @param {string} policy Name of the policy.
37 */
38 addPolicy: function(policy) {
39 // TODO(fhorschig): Create policy paper-items with possibility to (un)fold.
40 var node = document.createElement('p');
41 node.textContent = policy;
42 this.$.content.appendChild(node);
43 },
44 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698