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

Unified Diff: chrome/browser/resources/options/pref_ui.js

Issue 6737035: Proxy settings automation hooks and related proxy settings fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Other nits. Created 9 years, 9 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/options/pref_ui.js
diff --git a/chrome/browser/resources/options/pref_ui.js b/chrome/browser/resources/options/pref_ui.js
index d7e783c7dd2c9d9e9759356b6d34e7ba63f3bf50..321604380f48e7491bdd6481d9255af784e4f05f 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -481,7 +481,19 @@ cr.define('options', function() {
// Listen to user events.
this.addEventListener('change',
function(e) {
- Preferences.setStringPref(self.pref, self.value, self.metric);
+ switch(self.dataType) {
+ case 'number':
+ Preferences.setIntegerPref(self.pref, parseInt(self.value, 10),
+ self.metric);
+ break;
+ case 'double':
+ Preferences.setDoublePref(self.pref, parseFloat(self.value),
+ self.metric);
+ break;
+ default:
+ Preferences.setStringPref(self.pref, self.value, self.metric);
+ break;
+ }
});
window.addEventListener('unload',
@@ -504,6 +516,12 @@ cr.define('options', function() {
*/
cr.defineProperty(PrefTextField, 'metric', cr.PropertyKind.ATTR);
+ /**
+ * The data type for the preference options.
+ * @type {string}
+ */
+ cr.defineProperty(PrefTextField, 'dataType', cr.PropertyKind.ATTR);
+
// Export
return {
PrefCheckbox: PrefCheckbox,

Powered by Google App Engine
This is Rietveld 408576698