| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 */ | 110 */ |
| 111 onDeleteMultipleSites_: function() { | 111 onDeleteMultipleSites_: function() { |
| 112 if (this.filterString_.length == 0) { | 112 if (this.filterString_.length == 0) { |
| 113 this.removeAllCookies(); | 113 this.removeAllCookies(); |
| 114 } else { | 114 } else { |
| 115 var items = this.$.list.items; | 115 var items = this.$.list.items; |
| 116 for (var i = 0; i < items.length; ++i) { | 116 for (var i = 0; i < items.length; ++i) { |
| 117 if (this.showItem_(items[i])) | 117 if (this.showItem_(items[i])) |
| 118 this.browserProxy.removeCookie(items[i].id); | 118 this.browserProxy.removeCookie(items[i].id); |
| 119 } | 119 } |
| 120 // We just deleted all items found by the filter, let's reset the filter. |
| 121 /** @type {SettingsSubpageSearchElement} */(this.$.filter).setValue(''); |
| 120 } | 122 } |
| 121 }, | 123 }, |
| 122 | 124 |
| 123 /** | 125 /** |
| 124 * @param {!{model: !{item: CookieDataSummaryItem}}} event | 126 * @param {!{model: !{item: CookieDataSummaryItem}}} event |
| 125 * @private | 127 * @private |
| 126 */ | 128 */ |
| 127 onSiteTap_: function(event) { | 129 onSiteTap_: function(event) { |
| 128 var dialog = document.createElement('site-data-details-dialog'); | 130 var dialog = document.createElement('site-data-details-dialog'); |
| 129 dialog.category = this.category; | 131 dialog.category = this.category; |
| 130 this.shadowRoot.appendChild(dialog); | 132 this.shadowRoot.appendChild(dialog); |
| 131 | 133 |
| 132 var node = this.rootCookieNode.fetchNodeById(event.model.item.id, false); | 134 var node = this.rootCookieNode.fetchNodeById(event.model.item.id, false); |
| 133 dialog.open(node); | 135 dialog.open(node); |
| 134 | 136 |
| 135 dialog.addEventListener('close', function(event) { | 137 dialog.addEventListener('close', function(event) { |
| 136 dialog.remove(); | 138 dialog.remove(); |
| 137 }); | 139 }); |
| 138 }, | 140 }, |
| 139 }); | 141 }); |
| OLD | NEW |