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

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: fix test 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..4a44b5e003e45c870f1029f97e83878f6cca226b 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 */
@@ -78,9 +85,8 @@ Polymer({
* @param {!Event} e
* @private
*/
- onConfirmDeleteMultipleSites_: function(e) {
+ onRemoveAllTap_: function(e) {
e.preventDefault();
- this.idToDelete_ = ''; // Delete all.
this.confirmationDeleteMsg_ = loadTimeData.getString(
'siteSettingsCookieRemoveMultipleConfirmation');
this.$.confirmDeleteDialog.showModal();
@@ -91,26 +97,8 @@ Polymer({
* @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 +113,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