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

Side by Side Diff: chrome/browser/resources/settings/controls/settings_radio_group.js

Issue 2617663002: WIP: run clang-format-js on lots of things (Closed)
Patch Set: merge Created 3 years, 11 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
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 * <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 * </settings-radio-group> 13 * </settings-radio-group>
14 */ 14 */
15 Polymer({ 15 Polymer({
16 is: 'settings-radio-group', 16 is: 'settings-radio-group',
17 17
18 behaviors: [PrefControlBehavior], 18 behaviors: [PrefControlBehavior],
19 19
20 properties: { 20 properties: {
21 /** 21 /**
22 * IronSelectableBehavior selected attribute. 22 * IronSelectableBehavior selected attribute.
23 */ 23 */
24 selected: { 24 selected: {type: String, notify: true, observer: 'selectedChanged_'},
25 type: String,
26 notify: true,
27 observer: 'selectedChanged_'
28 },
29 }, 25 },
30 26
31 observers: [ 27 observers: [
32 'prefChanged_(pref.*)', 28 'prefChanged_(pref.*)',
33 ], 29 ],
34 30
35 /** @private */ 31 /** @private */
36 prefChanged_: function() { 32 prefChanged_: function() {
37 var pref = /** @type {!chrome.settingsPrivate.PrefObject} */(this.pref); 33 var pref = /** @type {!chrome.settingsPrivate.PrefObject} */ (this.pref);
38 this.selected = Settings.PrefUtil.prefToString(pref); 34 this.selected = Settings.PrefUtil.prefToString(pref);
39 }, 35 },
40 36
41 /** @private */ 37 /** @private */
42 selectedChanged_: function(selected) { 38 selectedChanged_: function(selected) {
43 if (!this.pref) 39 if (!this.pref)
44 return; 40 return;
45 this.set('pref.value', 41 this.set(
46 Settings.PrefUtil.stringToPrefValue(selected, this.pref)); 42 'pref.value', Settings.PrefUtil.stringToPrefValue(selected, this.pref));
47 }, 43 },
48 }); 44 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698