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

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: Address nits 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
« no previous file with comments | « chrome/browser/resources/md_history/list_container.html ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f8bbac03555fd47d47270079290d4d7d36a0b348 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -83,9 +83,15 @@ Polymer({
.unselectAllItems(count);
},
- deleteSelected: function() {
- /** @type {HistoryListElement} */ (this.$['infinite-list'])
- .deleteSelected();
+ /**
+ * Delete all the currently selected history items. Will prompt the user with
+ * a dialog to confirm that the deletion should be performed.
+ */
+ deleteSelectedWithPrompt: function() {
+ if (!loadTimeData.getBoolean('allowDeletingHistory'))
+ return;
+
+ this.$.dialog.open();
},
/**
@@ -131,4 +137,15 @@ Polymer({
}
}
},
+
+ /** @private */
+ onDialogConfirmTap_: function() {
+ this.$['infinite-list'].deleteSelected();
+ this.$.dialog.close();
+ },
+
+ /** @private */
+ onDialogCancelTap_: function() {
+ this.$.dialog.close();
+ }
});
« no previous file with comments | « chrome/browser/resources/md_history/list_container.html ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698