| 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-radio-group` wraps a radio-group and set of radio-buttons that control | 7 * `cr-radio-group` wraps a radio-group and set of radio-buttons that control |
| 8 * a supplied preference. | 8 * a supplied preference. |
| 9 * | 9 * |
| 10 * Example: | 10 * Example: |
| 11 * <cr-settings-radio-group pref="{{prefs.settings.foo}}" | 11 * <settings-radio-group pref="{{prefs.settings.foo}}" |
| 12 * label="Foo Options." buttons="{{fooOptionsList}}"> | 12 * label="Foo Options." buttons="{{fooOptionsList}}"> |
| 13 * </cr-settings-radio-group> | 13 * </settings-radio-group> |
| 14 * | 14 * |
| 15 * @element cr-settings-radio-group | 15 * @element settings-radio-group |
| 16 */ | 16 */ |
| 17 Polymer({ | 17 Polymer({ |
| 18 is: 'cr-settings-radio-group', | 18 is: 'settings-radio-group', |
| 19 | 19 |
| 20 properties: { | 20 properties: { |
| 21 /** | 21 /** |
| 22 * The preference object to control. | 22 * The preference object to control. |
| 23 * @type {chrome.settingsPrivate.PrefObject|undefined} | 23 * @type {chrome.settingsPrivate.PrefObject|undefined} |
| 24 */ | 24 */ |
| 25 pref: { | 25 pref: { |
| 26 type: Object, | 26 type: Object, |
| 27 notify: true, | 27 notify: true, |
| 28 observer: 'prefChanged_' | 28 observer: 'prefChanged_' |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 this.set('pref.value', n); | 63 this.set('pref.value', n); |
| 64 } else if (this.pref.type == chrome.settingsPrivate.PrefType.BOOLEAN) { | 64 } else if (this.pref.type == chrome.settingsPrivate.PrefType.BOOLEAN) { |
| 65 this.set('pref.value', this.selected == 'true'); | 65 this.set('pref.value', this.selected == 'true'); |
| 66 } else { | 66 } else { |
| 67 assert(this.pref.type != chrome.settingsPrivate.PrefType.LIST); | 67 assert(this.pref.type != chrome.settingsPrivate.PrefType.LIST); |
| 68 this.set('pref.value', this.selected); | 68 this.set('pref.value', this.selected); |
| 69 } | 69 } |
| 70 }, | 70 }, |
| 71 }); | 71 }); |
| OLD | NEW |