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

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

Issue 2044963003: Site Settings Desktop: Change how adding site exceptions work. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/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 866da1aaab6c6b9dc62182d84690cdfce64a9f40..94fedf38a7e5140d1146fc8a5a48e7892fe48fa9 100644
--- a/chrome/browser/resources/settings/site_settings/site_list.js
+++ b/chrome/browser/resources/settings/site_settings/site_list.js
@@ -172,13 +172,27 @@ Polymer({
},
/**
- * Makes sure the visibility is correct for this widget (e.g. hidden if the
- * block list is empty).
+ * Makes sure the visibility is correct for this widget.
* @private
*/
updateCategoryVisibility_: function() {
- this.$.category.hidden =
- !this.showSiteList_(this.sites, this.categoryEnabled);
+ this.$.category.hidden = !this.showSiteList_(this.categoryEnabled);
+ },
+
+ /**
+ * A handler for the Add Site button.
+ * @private
+ */
+ onAddSiteTap_: function() {
+ var dialog = document.createElement('add-site-dialog');
+ dialog.category = this.category;
+ this.shadowRoot.appendChild(dialog);
+
+ dialog.open(this.categorySubtype);
+
+ dialog.addEventListener('iron-overlay-closed', function() {
+ dialog.remove();
+ });
},
/**
@@ -434,16 +448,11 @@ Polymer({
/**
* Returns whether to show the site list.
- * @param {Array} siteList The list of all sites to display for this category
- * subtype.
* @param {boolean} toggleState The state of the global toggle for this
* category.
* @private
*/
- showSiteList_: function(siteList, toggleState) {
- if (siteList.length == 0)
- return false;
-
+ showSiteList_: function(toggleState) {
// The Block list is only shown when the category is set to Allow since it
// is redundant to also list all the sites that are blocked.
if (this.isAllowList_())

Powered by Google App Engine
This is Rietveld 408576698