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

Unified Diff: chrome/browser/resources/settings/radio_group/radio_group.js

Issue 1379483003: Rename cr-settings-elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/radio_group/radio_group.js
diff --git a/chrome/browser/resources/settings/radio_group/radio_group.js b/chrome/browser/resources/settings/radio_group/radio_group.js
deleted file mode 100644
index 0711680e3438c43491a1de7336e2d192adf0a010..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/settings/radio_group/radio_group.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * `cr-radio-group` wraps a radio-group and set of radio-buttons that control
- * a supplied preference.
- *
- * Example:
- * <cr-settings-radio-group pref="{{prefs.settings.foo}}"
- * label="Foo Options." buttons="{{fooOptionsList}}">
- * </cr-settings-radio-group>
- *
- * @element cr-settings-radio-group
- */
-Polymer({
- is: 'cr-settings-radio-group',
-
- properties: {
- /**
- * The preference object to control.
- * @type {chrome.settingsPrivate.PrefObject|undefined}
- */
- pref: {
- type: Object,
- notify: true,
- observer: 'prefChanged_'
- },
-
- /**
- * IronSelectableBehavior selected attribute
- */
- selected: {
- type: String,
- observer: 'selectedChanged_'
- },
- },
-
- /** @private */
- prefChanged_: function() {
- if (!this.pref)
- return;
- if (this.pref.type == chrome.settingsPrivate.PrefType.NUMBER ||
- this.pref.type == chrome.settingsPrivate.PrefType.BOOLEAN) {
- this.selected = this.pref.value.toString();
- } else {
- assert(this.pref.type != chrome.settingsPrivate.PrefType.LIST);
- this.selected = /** @type {string} */(this.pref.value);
- }
- },
-
- /** @private */
- selectedChanged_: function() {
- if (!this.pref)
- return;
- if (this.pref.type == chrome.settingsPrivate.PrefType.NUMBER) {
- var n = parseInt(this.selected, 10);
- if (isNaN(n)) {
- console.error('Bad selected name for numerical pref: ' + this.selected);
- return;
- }
- this.set('pref.value', n);
- } else if (this.pref.type == chrome.settingsPrivate.PrefType.BOOLEAN) {
- this.set('pref.value', this.selected == 'true');
- } else {
- assert(this.pref.type != chrome.settingsPrivate.PrefType.LIST);
- this.set('pref.value', this.selected);
- }
- },
-});

Powered by Google App Engine
This is Rietveld 408576698