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

Unified Diff: chrome/browser/resources/settings/site_settings/category_default_setting.js

Issue 2617663002: WIP: run clang-format-js on lots of things (Closed)
Patch Set: merge Created 3 years, 11 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/site_settings/category_default_setting.js
diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.js b/chrome/browser/resources/settings/site_settings/category_default_setting.js
index d360ef9c6f028a87529b9ee19e74118c6d47defc..8007f4bce9466a332a6b53425c8df38aa6bf254d 100644
--- a/chrome/browser/resources/settings/site_settings/category_default_setting.js
+++ b/chrome/browser/resources/settings/site_settings/category_default_setting.js
@@ -17,7 +17,7 @@ Polymer({
controlParams_: {
type: Object,
value: function() {
- return /** @type {chrome.settingsPrivate.PrefObject} */({});
+ return /** @type {chrome.settingsPrivate.PrefObject} */ ({});
},
},
@@ -25,7 +25,7 @@ Polymer({
priorDefaultContentSetting_: {
type: Object,
value: function() {
- return /** @type {DefaultContentSetting} */({});
+ return /** @type {DefaultContentSetting} */ ({});
},
},
@@ -43,7 +43,7 @@ Polymer({
subControlParams_: {
type: Object,
value: function() {
- return /** @type {chrome.settingsPrivate.PrefObject} */({});
+ return /** @type {chrome.settingsPrivate.PrefObject} */ ({});
},
},
},
@@ -51,12 +51,12 @@ Polymer({
observers: [
'onCategoryChanged_(category)',
'onChangePermissionControl_(category, controlParams_.value, ' +
- 'subControlParams_.value)',
+ 'subControlParams_.value)',
],
ready: function() {
- this.addWebUIListener('contentSettingCategoryChanged',
- this.onCategoryChanged_.bind(this));
+ this.addWebUIListener(
+ 'contentSettingCategoryChanged', this.onCategoryChanged_.bind(this));
},
/** @return {boolean} */
@@ -77,8 +77,7 @@ Polymer({
case settings.ContentSettingsTypes.PROTOCOL_HANDLERS:
// "Allowed" vs "Blocked".
this.browserProxy.setDefaultValueForContentType(
- this.category,
- this.categoryEnabled ?
+ this.category, this.categoryEnabled ?
settings.PermissionValues.ALLOW :
settings.PermissionValues.BLOCK);
break;
@@ -90,8 +89,7 @@ Polymer({
case settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS:
// "Ask" vs "Blocked".
this.browserProxy.setDefaultValueForContentType(
- this.category,
- this.categoryEnabled ?
+ this.category, this.categoryEnabled ?
settings.PermissionValues.ASK :
settings.PermissionValues.BLOCK);
break;
@@ -150,7 +148,7 @@ Polymer({
var prefValue = this.computeIsSettingEnabled(update.setting);
// The controlParams_ must be replaced (rather than just value changes) so
// that observers will be notified of the change.
- this.controlParams_ = /** @type {chrome.settingsPrivate.PrefObject} */(
+ this.controlParams_ = /** @type {chrome.settingsPrivate.PrefObject} */ (
Object.assign({'value': prefValue}, basePref));
var subPrefValue = false;
@@ -159,14 +157,15 @@ Polymer({
if (this.category == settings.ContentSettingsTypes.PLUGINS &&
update.setting == settings.PermissionValues.IMPORTANT_CONTENT) {
subPrefValue = true;
- } else if (this.category == settings.ContentSettingsTypes.COOKIES &&
+ } else if (
+ this.category == settings.ContentSettingsTypes.COOKIES &&
update.setting == settings.PermissionValues.SESSION_ONLY) {
subPrefValue = true;
}
}
// The subControlParams_ must be replaced (rather than just value changes)
// so that observers will be notified of the change.
- this.subControlParams_ = /** @type {chrome.settingsPrivate.PrefObject} */(
+ this.subControlParams_ = /** @type {chrome.settingsPrivate.PrefObject} */ (
Object.assign({'value': subPrefValue}, basePref));
},
@@ -175,23 +174,22 @@ Polymer({
* @private
*/
onCategoryChanged_: function() {
- this.browserProxy
- .getDefaultValueForContentType(
- this.category).then(function(defaultValue) {
- this.updateControlParams_(defaultValue);
-
- // Flash only shows ALLOW or BLOCK descriptions on the slider.
- var setting = defaultValue.setting;
- if (this.category == settings.ContentSettingsTypes.PLUGINS &&
- setting == settings.PermissionValues.IMPORTANT_CONTENT) {
- setting = settings.PermissionValues.ALLOW;
- } else if (
- this.category == settings.ContentSettingsTypes.COOKIES &&
- setting == settings.PermissionValues.SESSION_ONLY) {
- setting = settings.PermissionValues.ALLOW;
- }
- this.sliderDescription_ =
- this.computeCategoryDesc(this.category, setting, true);
- }.bind(this));
+ this.browserProxy.getDefaultValueForContentType(this.category)
+ .then(function(defaultValue) {
+ this.updateControlParams_(defaultValue);
+
+ // Flash only shows ALLOW or BLOCK descriptions on the slider.
+ var setting = defaultValue.setting;
+ if (this.category == settings.ContentSettingsTypes.PLUGINS &&
+ setting == settings.PermissionValues.IMPORTANT_CONTENT) {
+ setting = settings.PermissionValues.ALLOW;
+ } else if (
+ this.category == settings.ContentSettingsTypes.COOKIES &&
+ setting == settings.PermissionValues.SESSION_ONLY) {
+ setting = settings.PermissionValues.ALLOW;
+ }
+ this.sliderDescription_ =
+ this.computeCategoryDesc(this.category, setting, true);
+ }.bind(this));
},
});

Powered by Google App Engine
This is Rietveld 408576698