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

Unified Diff: chrome/browser/resources/md_history/list_container.js

Issue 2077483002: MD History: Add confirmation dialog when deleting items from the toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cr_refactor_dialog
Patch Set: Fix test Created 4 years, 5 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/md_history/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index 76cb2f5e1c83e3d5793157e4072a9bf2ce4ad373..917d35b52f067c9aabd00d0cb1538d4259bafdbe 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -83,9 +83,14 @@ Polymer({
.unselectAllItems(count);
},
+ /**
+ * Delete all the currently selected history items. Will prompt the user with
+ * a dialog to confirm that the deletion should be performed.
+ */
deleteSelected: function() {
calamity 2016/07/08 06:05:50 promptDeleteSelected perhaps? promptDeletion? I j
tsergeant 2016/07/08 06:37:27 Done.
- /** @type {HistoryListElement} */ (this.$['infinite-list'])
- .deleteSelected();
+ if (!loadTimeData.getBoolean('allowDeletingHistory'))
+ return;
calamity 2016/07/08 06:05:50 nit: newline here.
tsergeant 2016/07/08 06:37:27 Done.
+ this.$.dialog.open();
},
/**
@@ -131,4 +136,15 @@ Polymer({
}
}
},
+
+ /** @private */
+ onDialogConfirmTap_: function() {
+ this.$['infinite-list'].deleteSelected();
+ this.$.dialog.close();
+ },
+
+ /** @private */
+ onDialogCancelTap_: function() {
+ this.$.dialog.close();
+ }
});

Powered by Google App Engine
This is Rietveld 408576698