| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |