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

Side by Side 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 unified diff | Download patch
OLDNEW
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 Polymer({ 5 Polymer({
6 is: 'history-list-container', 6 is: 'history-list-container',
7 7
8 properties: { 8 properties: {
9 // The path of the currently selected page. 9 // The path of the currently selected page.
10 selectedPage_: String, 10 selectedPage_: String,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 queryState.searchTerm, queryState.groupedOffset, queryState.range, 76 queryState.searchTerm, queryState.groupedOffset, queryState.range,
77 lastVisitTime, maxResults 77 lastVisitTime, maxResults
78 ]); 78 ]);
79 }, 79 },
80 80
81 unselectAllItems: function(count) { 81 unselectAllItems: function(count) {
82 /** @type {HistoryListElement} */ (this.$['infinite-list']) 82 /** @type {HistoryListElement} */ (this.$['infinite-list'])
83 .unselectAllItems(count); 83 .unselectAllItems(count);
84 }, 84 },
85 85
86 deleteSelected: function() { 86 /**
87 /** @type {HistoryListElement} */ (this.$['infinite-list']) 87 * Delete all the currently selected history items. Will prompt the user with
88 .deleteSelected(); 88 * a dialog to confirm that the deletion should be performed.
89 */
90 deleteSelectedWithPrompt: function() {
91 if (!loadTimeData.getBoolean('allowDeletingHistory'))
92 return;
93
94 this.$.dialog.open();
89 }, 95 },
90 96
91 /** 97 /**
92 * @param {string} searchTerm 98 * @param {string} searchTerm
93 * @private 99 * @private
94 */ 100 */
95 searchTermChanged_: function(searchTerm) { this.queryHistory(false); }, 101 searchTermChanged_: function(searchTerm) { this.queryHistory(false); },
96 102
97 /** 103 /**
98 * @param {HistoryRange} range 104 * @param {HistoryRange} range
(...skipping 25 matching lines...) Expand all
124 // Sets the default values for these fields to prevent undefined types. 130 // Sets the default values for these fields to prevent undefined types.
125 results[i].selected = false; 131 results[i].selected = false;
126 results[i].readableTimestamp = 132 results[i].readableTimestamp =
127 info.term == '' ? results[i].dateTimeOfDay : results[i].dateShort; 133 info.term == '' ? results[i].dateTimeOfDay : results[i].dateShort;
128 134
129 if (results[i].dateRelativeDay != currentDate) { 135 if (results[i].dateRelativeDay != currentDate) {
130 currentDate = results[i].dateRelativeDay; 136 currentDate = results[i].dateRelativeDay;
131 } 137 }
132 } 138 }
133 }, 139 },
140
141 /** @private */
142 onDialogConfirmTap_: function() {
143 this.$['infinite-list'].deleteSelected();
144 this.$.dialog.close();
145 },
146
147 /** @private */
148 onDialogCancelTap_: function() {
149 this.$.dialog.close();
150 }
134 }); 151 });
OLDNEW
« 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