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 /** | 10 /** |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 cr.ui.focusWithoutInk(assert(this.$.removeShowingSites)); | 112 cr.ui.focusWithoutInk(assert(this.$.removeShowingSites)); |
113 }, | 113 }, |
114 | 114 |
115 /** | 115 /** |
116 * Shows a dialog to confirm the deletion of multiple sites. | 116 * Shows a dialog to confirm the deletion of multiple sites. |
117 * @param {!Event} e | 117 * @param {!Event} e |
118 * @private | 118 * @private |
119 */ | 119 */ |
120 onRemoveShowingSitesTap_: function(e) { | 120 onRemoveShowingSitesTap_: function(e) { |
121 e.preventDefault(); | 121 e.preventDefault(); |
122 this.confirmationDeleteMsg_ = loadTimeData.getString( | 122 this.confirmationDeleteMsg_ = |
123 'siteSettingsCookieRemoveMultipleConfirmation'); | 123 loadTimeData.getString('siteSettingsCookieRemoveMultipleConfirmation'); |
124 this.$.confirmDeleteDialog.showModal(); | 124 this.$.confirmDeleteDialog.showModal(); |
125 }, | 125 }, |
126 | 126 |
127 /** | 127 /** |
128 * Called when deletion for all showing sites has been confirmed. | 128 * Called when deletion for all showing sites has been confirmed. |
129 * @private | 129 * @private |
130 */ | 130 */ |
131 onConfirmDelete_: function() { | 131 onConfirmDelete_: function() { |
132 this.$.confirmDeleteDialog.close(); | 132 this.$.confirmDeleteDialog.close(); |
133 | 133 |
134 if (this.filterString_.length == 0) { | 134 if (this.filterString_.length == 0) { |
135 this.removeAllCookies(); | 135 this.removeAllCookies(); |
136 } else { | 136 } else { |
137 var items = this.$.list.items; | 137 var items = this.$.list.items; |
138 for (var i = 0; i < items.length; ++i) { | 138 for (var i = 0; i < items.length; ++i) { |
139 if (this.showItem_(items[i])) | 139 if (this.showItem_(items[i])) |
140 this.browserProxy.removeCookie(items[i].id); | 140 this.browserProxy.removeCookie(items[i].id); |
141 } | 141 } |
142 // We just deleted all items found by the filter, let's reset the filter. | 142 // We just deleted all items found by the filter, let's reset the filter. |
143 /** @type {SettingsSubpageSearchElement} */(this.$.filter).setValue(''); | 143 /** @type {SettingsSubpageSearchElement} */ (this.$.filter).setValue(''); |
144 } | 144 } |
145 }, | 145 }, |
146 | 146 |
147 /** | 147 /** |
148 * Deletes all site data for a given site. | 148 * Deletes all site data for a given site. |
149 * @param {!DomRepeatEvent} e | 149 * @param {!DomRepeatEvent} e |
150 * @private | 150 * @private |
151 */ | 151 */ |
152 onRemoveSiteTap_: function(e) { | 152 onRemoveSiteTap_: function(e) { |
153 e.stopPropagation(); | 153 e.stopPropagation(); |
154 this.browserProxy.removeCookie(e.model.item.id); | 154 this.browserProxy.removeCookie(e.model.item.id); |
155 }, | 155 }, |
156 | 156 |
157 /** | 157 /** |
158 * @param {!{model: !{item: CookieDataSummaryItem}}} event | 158 * @param {!{model: !{item: CookieDataSummaryItem}}} event |
159 * @private | 159 * @private |
160 */ | 160 */ |
161 onSiteTap_: function(event) { | 161 onSiteTap_: function(event) { |
162 settings.navigateTo(settings.Route.SITE_SETTINGS_DATA_DETAILS, | 162 settings.navigateTo( |
| 163 settings.Route.SITE_SETTINGS_DATA_DETAILS, |
163 new URLSearchParams('site=' + event.model.item.site)); | 164 new URLSearchParams('site=' + event.model.item.site)); |
164 }, | 165 }, |
165 }); | 166 }); |
OLD | NEW |