Fire an error if a pref used in the UI is missing once all prefs are fetched.
[chromium-blink-merge.git] / chrome / browser / resources / settings / checkbox / checkbox.js
blobd32b2d845b10bb0c4e919319ee141963bfee6727
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.
5 /**
6 * @fileoverview
7 * `cr-settings-checkbox` is a checkbox that controls a supplied preference.
9 * Example:
10 * <cr-settings-checkbox pref="{{prefs.settings.enableFoo}}"
11 * label="Enable foo setting." subLabel="(bar also)">
12 * </cr-settings-checkbox>
14 * @element cr-settings-checkbox
16 Polymer({
17 publish: {
18 /**
19 * The boolean preference to control.
21 * @attribute pref
22 * @type {Object}
23 * @default null
25 pref: null,
27 /**
28 * @attribute label
29 * @type {string}
30 * @default ''
32 label: '',
34 /**
35 * @attribute label
36 * @type {string}
37 * @default ''
39 subLabel: '',
42 ready: function() {
43 this.$.events.forward(this.$.checkbox, ['change']);
45 });