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

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_data.js

Issue 2370843002: Site Settings Desktop: Only show Remove action if filter hasn't removed all. (Closed)
Patch Set: Address feedback Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_data.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'site-data' handles showing the local storage summary list for all sites. 7 * 'site-data' handles showing the local storage summary list for all sites.
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return true; 69 return true;
70 return item.site.indexOf(this.filterString_) > -1; 70 return item.site.indexOf(this.filterString_) > -1;
71 }, 71 },
72 72
73 /** @private */ 73 /** @private */
74 onSearchChanged_: function(e) { 74 onSearchChanged_: function(e) {
75 this.filterString_ = e.detail; 75 this.filterString_ = e.detail;
76 this.$.list.render(); 76 this.$.list.render();
77 }, 77 },
78 78
79 /** 79 /** @private */
80 * Returns whether remove all should be shown. 80 isRemoveButtonVisible_: function(sites, renderedItemCount) {
81 * @param {!Array<!CookieDataSummaryItem>} sites The sites list to use to 81 return renderedItemCount != 0;
82 * determine whether the button should be visible.
83 * @private
84 */
85 removeAllIsVisible_: function(sites) {
86 return sites.length > 0;
87 }, 82 },
88 83
89 /** 84 /**
90 * Returns the string to use for the Remove label. 85 * Returns the string to use for the Remove label.
91 * @return {!string} filterString The current filter string. 86 * @return {!string} filterString The current filter string.
92 * @private 87 * @private
93 */ 88 */
94 computeRemoveLabel_: function(filterString) { 89 computeRemoveLabel_: function(filterString) {
95 if (filterString.length == 0) 90 if (filterString.length == 0)
96 return loadTimeData.getString('siteSettingsCookieRemoveAll'); 91 return loadTimeData.getString('siteSettingsCookieRemoveAll');
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 this.shadowRoot.appendChild(dialog); 177 this.shadowRoot.appendChild(dialog);
183 178
184 var node = this.treeNodes_.fetchNodeById(event.model.item.id, false); 179 var node = this.treeNodes_.fetchNodeById(event.model.item.id, false);
185 dialog.open(node); 180 dialog.open(node);
186 181
187 dialog.addEventListener('close', function(event) { 182 dialog.addEventListener('close', function(event) {
188 dialog.remove(); 183 dialog.remove();
189 }); 184 });
190 }, 185 },
191 }); 186 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_data.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698