summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-18 21:49:21 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-18 21:49:21 +0000
commite0e25a2ac362308ec7b48b279b1acdb0b5691b51 (patch)
treee0ffabaf773d7d7a68890ede2f6085f73689d5f7
parent5535deb36f4eec42639bb776ade5b48889c62a47 (diff)
downloadchromium_src-e0e25a2ac362308ec7b48b279b1acdb0b5691b51.zip
chromium_src-e0e25a2ac362308ec7b48b279b1acdb0b5691b51.tar.gz
chromium_src-e0e25a2ac362308ec7b48b279b1acdb0b5691b51.tar.bz2
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
-rw-r--r--chrome/browser/resources/options/pref_ui.js34
-rw-r--r--chrome/browser/resources/options/preferences.js36
2 files changed, 30 insertions, 40 deletions
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index 58d49a7..b6f495c 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -138,20 +138,15 @@ 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.
* @type {string}
*/
@@ -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() {
*/
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:
diff --git a/chrome/browser/resources/options/preferences.js b/chrome/browser/resources/options/preferences.js
index a9c7b05..1b242337 100644
--- a/chrome/browser/resources/options/preferences.js
+++ b/chrome/browser/resources/options/preferences.js
@@ -44,9 +44,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier.
*/
Preferences.setBooleanPref = function (name, value, metric) {
- var arguments = [name, value ? 'true' : 'false'];
- if (metric != undefined) arguments.push(metric);
- chrome.send('setBooleanPref', arguments);
+ var argumentList = [name, value ? 'true' : 'false'];
+ if (metric != undefined) argumentList.push(metric);
+ chrome.send('setBooleanPref', argumentList);
};
/**
@@ -57,9 +57,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier.
*/
Preferences.setIntegerPref = function(name, value, metric) {
- var arguments = [name, String(value)];
- if (metric != undefined) arguments.push(metric);
- chrome.send('setIntegerPref', arguments);
+ var argumentList = [name, String(value)];
+ if (metric != undefined) argumentList.push(metric);
+ chrome.send('setIntegerPref', argumentList);
};
/**
@@ -70,9 +70,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier.
*/
Preferences.setRealPref = function(name, value, metric) {
- var arguments = [name, String(value)];
- if (metric != undefined) arguments.push(metric);
- chrome.send('setRealPref', arguments);
+ var argumentList = [name, String(value)];
+ if (metric != undefined) argumentList.push(metric);
+ chrome.send('setRealPref', argumentList);
};
/**
@@ -83,9 +83,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier.
*/
Preferences.setStringPref = function(name, value, metric) {
- var arguments = [name, value];
- if (metric != undefined) arguments.push(metric);
- chrome.send('setStringPref', arguments);
+ var argumentList = [name, value];
+ if (metric != undefined) argumentList.push(metric);
+ chrome.send('setStringPref', argumentList);
};
/**
@@ -96,9 +96,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier.
*/
Preferences.setObjectPref = function(name, value, metric) {
- var arguments = [name, JSON.stringify(value)];
- if (metric != undefined) arguments.push(metric);
- chrome.send('setObjectPref', arguments);
+ var argumentList = [name, JSON.stringify(value)];
+ if (metric != undefined) argumentList.push(metric);
+ chrome.send('setObjectPref', argumentList);
};
/**
@@ -107,9 +107,9 @@ cr.define('options', function() {
* @param {string} metric User metrics identifier.
*/
Preferences.clearPref = function(name, metric) {
- var arguments = [name];
- if (metric != undefined) arguments.push(metric);
- chrome.send('clearPref', arguments);
+ var argumentList = [name];
+ if (metric != undefined) argumentList.push(metric);
+ chrome.send('clearPref', argumentList);
};
Preferences.prototype = {