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

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

Issue 2769453002: MD Settings: Allow deleting read-only content setting exceptions. (Closed)
Patch Set: fix stuff Created 3 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/settings/site_settings/site_list.js
diff --git a/chrome/browser/resources/settings/site_settings/site_list.js b/chrome/browser/resources/settings/site_settings/site_list.js
index 7765e36d08cbcab3489a2b7a9aeb1f3f86231df6..5f6a29c89eec2327844adea6c69fd473117cea54 100644
--- a/chrome/browser/resources/settings/site_settings/site_list.js
+++ b/chrome/browser/resources/settings/site_settings/site_list.js
@@ -62,7 +62,9 @@ Polymer({
*/
sites: {
type: Array,
- value: function() { return []; },
+ value: function() {
+ return [];
+ },
},
/**
@@ -74,10 +76,10 @@ Polymer({
},
/**
- * The type of category this widget is displaying data for. Normally
- * either 'allow' or 'block', representing which sites are allowed or
- * blocked respectively.
- */
+ * The type of category this widget is displaying data for. Normally
+ * either 'allow' or 'block', representing which sites are allowed or
+ * blocked respectively.
+ */
categorySubtype: {
type: String,
value: settings.INVALID_CATEGORY_SUBTYPE,
@@ -128,9 +130,7 @@ Polymer({
},
},
- observers: [
- 'configureWidget_(category, categorySubtype)'
- ],
+ observers: ['configureWidget_(category, categorySubtype)'],
ready: function() {
this.addWebUIListener('contentSettingSitePermissionChanged',
@@ -214,6 +214,17 @@ Polymer({
* @return {boolean}
* @private
*/
+ isResetButtonHidden_: function(source, readOnlyList) {
+ return this.isExceptionControlled_(source) || this.allSites ||
+ !readOnlyList;
+ },
+
+ /**
+ * @param {string} source Where the setting came from.
+ * @param {boolean} readOnlyList Whether the site exception list is read-only.
+ * @return {boolean}
+ * @private
+ */
isActionMenuHidden_: function(source, readOnlyList) {
return this.isExceptionControlled_(source) || this.allSites || readOnlyList;
},
@@ -494,6 +505,17 @@ Polymer({
* @param {!{model: !{item: !SiteException}}} e
* @private
*/
+ onResetButtonTap_: function(e) {
+ // Trigger same logic as opening the menu and choosing the Reset item.
+ this.actionMenuSite_ = e.model.item;
+ this.onActionMenuActivate_(settings.PermissionValues.DEFAULT);
+ this.actionMenuSite_ = null;
dschuyler 2017/03/22 21:19:19 Hmm, it looks like onActionMenuActivate_ is an eve
tommycli 2017/03/22 21:51:29 Done. Based on your feedback, I refactored it a bi
+ },
+
+ /**
+ * @param {!{model: !{item: !SiteException}}} e
+ * @private
+ */
onShowActionMenuTap_: function(e) {
this.actionMenuSite_ = e.model.item;
/** @type {!CrActionMenuElement} */ (
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_list.html ('k') | chrome/test/data/webui/settings/site_list_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698