Chromium Code Reviews| 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} */ ( |