OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * `cr-settings-checkbox` is a checkbox that controls a supplied preference. | 7 * `cr-settings-checkbox` is a checkbox that controls a supplied preference. |
8 * | 8 * |
9 * Example: | 9 * Example: |
10 * <cr-settings-checkbox pref="{{prefs.settings.enableFoo}}" | 10 * <cr-settings-checkbox pref="{{prefs.settings.enableFoo}}" |
11 * label="Enable foo setting." subLabel="(bar also)"> | 11 * label="Enable foo setting." subLabel="(bar also)"> |
12 * </cr-settings-checkbox> | 12 * </cr-settings-checkbox> |
13 * | 13 * |
14 * @element cr-settings-checkbox | 14 * @element cr-settings-checkbox |
15 */ | 15 */ |
16 Polymer({ | 16 Polymer({ |
17 publish: { | 17 is: 'cr-settings-checkbox', |
| 18 |
| 19 properties: { |
18 /** | 20 /** |
19 * The boolean preference to control. | 21 * The boolean preference object to control. |
20 * | 22 * @type {?chrome.settingsPrivate.PrefObject} |
21 * @attribute pref | |
22 * @type {Object} | |
23 * @default null | |
24 */ | 23 */ |
25 pref: null, | 24 pref: Object, |
26 | 25 |
27 /** | 26 label: { |
28 * @attribute label | 27 type: String, |
29 * @type {string} | 28 value: '', |
30 * @default '' | 29 }, |
31 */ | |
32 label: '', | |
33 | 30 |
34 /** | 31 subLabel: { |
35 * @attribute label | 32 type: String, |
36 * @type {string} | 33 value: '', |
37 * @default '' | 34 }, |
38 */ | |
39 subLabel: '', | |
40 }, | 35 }, |
41 | 36 |
| 37 /** @override */ |
42 ready: function() { | 38 ready: function() { |
43 this.$.events.forward(this.$.checkbox, ['change']); | 39 this.$.events.forward(this.$.checkbox, ['change']); |
44 }, | 40 }, |
45 }); | 41 }); |
OLD | NEW |