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

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

Issue 2686063004: MD Settings: make blowing away per-origin data (i.e. cookies) easier (Closed)
Patch Set: dschuyler@ review Created 3 years, 10 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_data.js
diff --git a/chrome/browser/resources/settings/site_settings/site_data.js b/chrome/browser/resources/settings/site_settings/site_data.js
index ab87956c66256e9e918dbc3ba5a8ea3af5472d7f..f5fd007a21827c0268714d0e7e96c9577f3abc48 100644
--- a/chrome/browser/resources/settings/site_settings/site_data.js
+++ b/chrome/browser/resources/settings/site_settings/site_data.js
@@ -7,6 +7,16 @@
* 'site-data' handles showing the local storage summary list for all sites.
*/
+/**
+ * TODO(dbeam): upstream to polymer externs?
+ * @constructor
+ * @extends {Event}
+ */
+function DomRepeatEvent() {}
+
+/** @type {?} */
+DomRepeatEvent.prototype.model;
+
Polymer({
is: 'site-data',
@@ -24,9 +34,6 @@ Polymer({
/** @private */
confirmationDeleteMsg_: String,
-
- /** @private */
- idToDelete_: String,
},
/** @override */
@@ -52,7 +59,10 @@ Polymer({
this.$.list.render();
},
- /** @private */
+ /**
+ * @return {boolean} Whether to show the multiple site remove button.
+ * @private
+ */
isRemoveButtonVisible_: function(sites, renderedItemCount) {
return renderedItemCount != 0;
},
@@ -78,39 +88,20 @@ Polymer({
* @param {!Event} e
* @private
*/
- onConfirmDeleteMultipleSites_: function(e) {
+ onRemoveShowingSitesTap_: function(e) {
e.preventDefault();
- this.idToDelete_ = ''; // Delete all.
this.confirmationDeleteMsg_ = loadTimeData.getString(
'siteSettingsCookieRemoveMultipleConfirmation');
this.$.confirmDeleteDialog.showModal();
},
/**
- * Called when deletion for a single/multiple sites has been confirmed.
+ * Called when deletion for all showing sites has been confirmed.
* @private
*/
onConfirmDelete_: function() {
- if (this.idToDelete_ != '')
- this.onDeleteSite_();
- else
- this.onDeleteMultipleSites_();
this.$.confirmDeleteDialog.close();
- },
-
- /**
- * Deletes all site data for a given site.
- * @private
- */
- onDeleteSite_: function() {
- this.browserProxy.removeCookie(this.idToDelete_);
- },
- /**
- * Deletes site data for multiple sites.
- * @private
- */
- onDeleteMultipleSites_: function() {
if (this.filterString_.length == 0) {
this.removeAllCookies();
} else {
@@ -125,6 +116,16 @@ Polymer({
},
/**
+ * Deletes all site data for a given site.
+ * @param {!DomRepeatEvent} e
+ * @private
+ */
+ onRemoveSiteTap_: function(e) {
+ e.stopPropagation();
+ this.browserProxy.removeCookie(e.model.item.id);
+ },
+
+ /**
* @param {!{model: !{item: CookieDataSummaryItem}}} event
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698