Commit e0e25a2a authored by estade@chromium.org's avatar estade@chromium.org

Small tabbed options fixes:

- use defineProperty macro where we can
- don't use |arguments| as a var name

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6335003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71698 0039d316-1c4b-4281-b951-d872f2087c98
parent 5535deb3
...@@ -138,19 +138,14 @@ cr.define('options', function() { ...@@ -138,19 +138,14 @@ cr.define('options', function() {
} }
}); });
}, },
/**
* The name of the preference.
* @type {string}
*/
get pref() {
return this.getAttribute('pref');
},
set pref(name) {
this.setAttribute('pref', name);
}
}; };
/**
* The preference name.
* @type {string}
*/
cr.defineProperty(PrefRadio, 'pref', cr.PropertyKind.ATTR);
/** /**
* The user metric string. * The user metric string.
* @type {string} * @type {string}
...@@ -434,17 +429,6 @@ cr.define('options', function() { ...@@ -434,17 +429,6 @@ cr.define('options', function() {
} }
}); });
}, },
/**
* The data type for the preference options.
* @type {string}
*/
get dataType() {
return this.getAttribute('dataType');
},
set dataType(name) {
this.setAttribute('dataType', name);
}
}; };
/** /**
...@@ -459,6 +443,12 @@ cr.define('options', function() { ...@@ -459,6 +443,12 @@ cr.define('options', function() {
*/ */
cr.defineProperty(PrefSelect, 'metric', cr.PropertyKind.ATTR); cr.defineProperty(PrefSelect, 'metric', cr.PropertyKind.ATTR);
/**
* The data type for the preference options.
* @type {string}
*/
cr.defineProperty(PrefSelect, 'dataType', cr.PropertyKind.ATTR);
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// PrefTextField class: // PrefTextField class:
......
...@@ -44,9 +44,9 @@ cr.define('options', function() { ...@@ -44,9 +44,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier. * @param {string} metric User metrics identifier.
*/ */
Preferences.setBooleanPref = function (name, value, metric) { Preferences.setBooleanPref = function (name, value, metric) {
var arguments = [name, value ? 'true' : 'false']; var argumentList = [name, value ? 'true' : 'false'];
if (metric != undefined) arguments.push(metric); if (metric != undefined) argumentList.push(metric);
chrome.send('setBooleanPref', arguments); chrome.send('setBooleanPref', argumentList);
}; };
/** /**
...@@ -57,9 +57,9 @@ cr.define('options', function() { ...@@ -57,9 +57,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier. * @param {string} metric User metrics identifier.
*/ */
Preferences.setIntegerPref = function(name, value, metric) { Preferences.setIntegerPref = function(name, value, metric) {
var arguments = [name, String(value)]; var argumentList = [name, String(value)];
if (metric != undefined) arguments.push(metric); if (metric != undefined) argumentList.push(metric);
chrome.send('setIntegerPref', arguments); chrome.send('setIntegerPref', argumentList);
}; };
/** /**
...@@ -70,9 +70,9 @@ cr.define('options', function() { ...@@ -70,9 +70,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier. * @param {string} metric User metrics identifier.
*/ */
Preferences.setRealPref = function(name, value, metric) { Preferences.setRealPref = function(name, value, metric) {
var arguments = [name, String(value)]; var argumentList = [name, String(value)];
if (metric != undefined) arguments.push(metric); if (metric != undefined) argumentList.push(metric);
chrome.send('setRealPref', arguments); chrome.send('setRealPref', argumentList);
}; };
/** /**
...@@ -83,9 +83,9 @@ cr.define('options', function() { ...@@ -83,9 +83,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier. * @param {string} metric User metrics identifier.
*/ */
Preferences.setStringPref = function(name, value, metric) { Preferences.setStringPref = function(name, value, metric) {
var arguments = [name, value]; var argumentList = [name, value];
if (metric != undefined) arguments.push(metric); if (metric != undefined) argumentList.push(metric);
chrome.send('setStringPref', arguments); chrome.send('setStringPref', argumentList);
}; };
/** /**
...@@ -96,9 +96,9 @@ cr.define('options', function() { ...@@ -96,9 +96,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier. * @param {string} metric User metrics identifier.
*/ */
Preferences.setObjectPref = function(name, value, metric) { Preferences.setObjectPref = function(name, value, metric) {
var arguments = [name, JSON.stringify(value)]; var argumentList = [name, JSON.stringify(value)];
if (metric != undefined) arguments.push(metric); if (metric != undefined) argumentList.push(metric);
chrome.send('setObjectPref', arguments); chrome.send('setObjectPref', argumentList);
}; };
/** /**
...@@ -107,9 +107,9 @@ cr.define('options', function() { ...@@ -107,9 +107,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier. * @param {string} metric User metrics identifier.
*/ */
Preferences.clearPref = function(name, metric) { Preferences.clearPref = function(name, metric) {
var arguments = [name]; var argumentList = [name];
if (metric != undefined) arguments.push(metric); if (metric != undefined) argumentList.push(metric);
chrome.send('clearPref', arguments); chrome.send('clearPref', argumentList);
}; };
Preferences.prototype = { Preferences.prototype = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment