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

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

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 years, 6 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 c0776fee447b9fc043dab46e16d958609c550cf1..bdf3e2e57b87b3fa2ea85cb72b6c0b0ca291649f 100644
--- a/chrome/browser/resources/options/pref_ui.js
+++ b/chrome/browser/resources/options/pref_ui.js
@@ -199,8 +199,8 @@ cr.define('options', function() {
*/
updatePrefFromState: function() {
var value = this.inverted_pref ? !this.checked : this.checked;
- Preferences.setBooleanPref(this.pref, value,
- !this.dialogPref, this.metric);
+ Preferences.setBooleanPref(
+ this.pref, value, !this.dialogPref, this.metric);
},
/** @override */
@@ -247,8 +247,8 @@ cr.define('options', function() {
*/
updatePrefFromState: function() {
if (this.validity.valid) {
- Preferences.setIntegerPref(this.pref, this.value,
- !this.dialogPref, this.metric);
+ Preferences.setIntegerPref(
+ this.pref, this.value, !this.dialogPref, this.metric);
}
},
};
@@ -256,7 +256,7 @@ cr.define('options', function() {
/////////////////////////////////////////////////////////////////////////////
// PrefRadio class:
- //Define a constructor that uses an input element as its underlying element.
+ // Define a constructor that uses an input element as its underlying element.
var PrefRadio = cr.ui.define('input');
PrefRadio.prototype = {
@@ -277,12 +277,12 @@ cr.define('options', function() {
*/
updatePrefFromState: function() {
if (this.value == 'true' || this.value == 'false') {
- Preferences.setBooleanPref(this.pref,
- this.value == String(this.checked),
- !this.dialogPref, this.metric);
+ Preferences.setBooleanPref(
+ this.pref, this.value == String(this.checked), !this.dialogPref,
+ this.metric);
} else {
- Preferences.setIntegerPref(this.pref, this.value,
- !this.dialogPref, this.metric);
+ Preferences.setIntegerPref(
+ this.pref, this.value, !this.dialogPref, this.metric);
}
},
@@ -335,10 +335,8 @@ cr.define('options', function() {
*/
updatePrefFromState: function() {
Preferences.setIntegerPref(
- this.pref,
- this.mapPositionToPref(parseInt(this.value, 10)),
- !this.dialogPref,
- this.metric);
+ this.pref, this.mapPositionToPref(parseInt(this.value, 10)),
+ !this.dialogPref, this.metric);
},
/** @override */
@@ -406,24 +404,24 @@ cr.define('options', function() {
var value = this.options[this.selectedIndex].value;
switch (this.dataType) {
case 'number':
- Preferences.setIntegerPref(this.pref, value,
- !this.dialogPref, this.metric);
+ Preferences.setIntegerPref(
+ this.pref, value, !this.dialogPref, this.metric);
break;
case 'double':
- Preferences.setDoublePref(this.pref, value,
- !this.dialogPref, this.metric);
+ Preferences.setDoublePref(
+ this.pref, value, !this.dialogPref, this.metric);
break;
case 'boolean':
- Preferences.setBooleanPref(this.pref, value == 'true',
- !this.dialogPref, this.metric);
+ Preferences.setBooleanPref(
+ this.pref, value == 'true', !this.dialogPref, this.metric);
break;
case 'string':
- Preferences.setStringPref(this.pref, value,
- !this.dialogPref, this.metric);
+ Preferences.setStringPref(
+ this.pref, value, !this.dialogPref, this.metric);
break;
default:
- console.error('Unknown data type for <select> UI element: ' +
- this.dataType);
+ console.error(
+ 'Unknown data type for <select> UI element: ' + this.dataType);
}
},
@@ -527,20 +525,20 @@ cr.define('options', function() {
updatePrefFromState: function(event) {
switch (this.dataType) {
case 'number':
- Preferences.setIntegerPref(this.pref, this.value,
- !this.dialogPref, this.metric);
+ Preferences.setIntegerPref(
+ this.pref, this.value, !this.dialogPref, this.metric);
break;
case 'double':
- Preferences.setDoublePref(this.pref, this.value,
- !this.dialogPref, this.metric);
+ Preferences.setDoublePref(
+ this.pref, this.value, !this.dialogPref, this.metric);
break;
case 'url':
- Preferences.setURLPref(this.pref, this.value,
- !this.dialogPref, this.metric);
+ Preferences.setURLPref(
+ this.pref, this.value, !this.dialogPref, this.metric);
break;
default:
- Preferences.setStringPref(this.pref, this.value,
- !this.dialogPref, this.metric);
+ Preferences.setStringPref(
+ this.pref, this.value, !this.dialogPref, this.metric);
break;
}
},
@@ -599,8 +597,9 @@ cr.define('options', function() {
// be disabled when the underlying Boolean preference is set to false by a
// policy or extension.
Preferences.getInstance().addEventListener(this.pref, function(event) {
- updateDisabledState(self, 'notUserModifiable',
- event.value.disabled && !event.value.value);
+ updateDisabledState(
+ self, 'notUserModifiable',
+ event.value.disabled && !event.value.value);
self.controlledBy = event.value.controlledBy;
});
},

Powered by Google App Engine
This is Rietveld 408576698