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

Side by Side Diff: chrome/browser/resources/md_history/app.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
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history_list.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-app', 6 is: 'history-app',
7 7
8 properties: { 8 properties: {
9 // The id of the currently selected page. 9 // The id of the currently selected page.
10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'}, 10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'},
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 * @private 78 * @private
79 */ 79 */
80 unselectAll: function() { 80 unselectAll: function() {
81 var listContainer = 81 var listContainer =
82 /** @type {HistoryListContainerElement} */ (this.$['history']); 82 /** @type {HistoryListContainerElement} */ (this.$['history']);
83 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); 83 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar);
84 listContainer.unselectAllItems(toolbar.count); 84 listContainer.unselectAllItems(toolbar.count);
85 toolbar.count = 0; 85 toolbar.count = 0;
86 }, 86 },
87 87
88 /**
89 * Listens for call to delete all selected items and loops through all items
90 * to determine which ones are selected and deletes these.
91 */
92 deleteSelected: function() { 88 deleteSelected: function() {
93 if (!loadTimeData.getBoolean('allowDeletingHistory')) 89 this.$.history.deleteSelectedWithPrompt();
94 return;
95
96 // TODO(hsampson): add a popup to check whether the user definitely
97 // wants to delete the selected items.
98 /** @type {HistoryListContainerElement} */ (this.$['history'])
99 .deleteSelected();
100 }, 90 },
101 91
102 /** 92 /**
103 * @param {HistoryQuery} info An object containing information about the 93 * @param {HistoryQuery} info An object containing information about the
104 * query. 94 * query.
105 * @param {!Array<HistoryEntry>} results A list of results. 95 * @param {!Array<HistoryEntry>} results A list of results.
106 */ 96 */
107 historyResult: function(info, results) { 97 historyResult: function(info, results) {
108 this.set('queryState_.querying', false); 98 this.set('queryState_.querying', false);
109 this.set('queryResult_.info', info); 99 this.set('queryResult_.info', info);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 * @param {boolean} incremental 146 * @param {boolean} incremental
157 * @param {string} searchTerm 147 * @param {string} searchTerm
158 * @return {boolean} Whether a loading spinner should be shown (implies the 148 * @return {boolean} Whether a loading spinner should be shown (implies the
159 * backend is querying a new search term). 149 * backend is querying a new search term).
160 * @private 150 * @private
161 */ 151 */
162 shouldShowSpinner_: function(querying, incremental, searchTerm) { 152 shouldShowSpinner_: function(querying, incremental, searchTerm) {
163 return querying && !incremental && searchTerm != ''; 153 return querying && !incremental && searchTerm != '';
164 }, 154 },
165 }); 155 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698