| Index: chrome/browser/resources/md_history/history.js
|
| diff --git a/chrome/browser/resources/md_history/history.js b/chrome/browser/resources/md_history/history.js
|
| index ceb5dab5be840a6da95a6a160fabe69ed0dc6523..ae6da278a7d8760938ccae0a38caeff0f5b6d49e 100644
|
| --- a/chrome/browser/resources/md_history/history.js
|
| +++ b/chrome/browser/resources/md_history/history.js
|
| @@ -17,15 +17,6 @@ window.addEventListener('load', function() {
|
| });
|
|
|
| /**
|
| - * Our history system calls this function with results from searches.
|
| - * @param {HistoryQuery} info An object containing information about the query.
|
| - * @param {Array<HistoryEntry>} results A list of results.
|
| - */
|
| -function historyResult(info, results) {
|
| - $('history-card-manager').addNewResults(results);
|
| -}
|
| -
|
| -/**
|
| * Listens for history-item being selected or deselected (through checkbox)
|
| * and changes the view of the top toolbar.
|
| */
|
| @@ -43,6 +34,23 @@ window.addEventListener('unselect-all', function() {
|
| });
|
|
|
| /**
|
| + * Listens for call to delete all selected items and loops through all items to
|
| + * to determine which ones are selected and deletes these.
|
| + */
|
| +window.addEventListener('delete-selected', function() {
|
| + if (!loadTimeData.getBoolean('allowDeletingHistory')) {
|
| + return;
|
| + }
|
| +
|
| + // TODO(hsampson): add a popup to check whether the user definitely wants to
|
| + // delete the selected items.
|
| +
|
| + var toBeRemoved =
|
| + $('history-card-manager').getSelectedItems($('toolbar').count);
|
| + chrome.send('removeVisits', toBeRemoved);
|
| +});
|
| +
|
| +/**
|
| * Listens for any keyboard presses which will close the overflow menu.
|
| */
|
| window.addEventListener('keydown', function(e) {
|
| @@ -58,3 +66,34 @@ window.addEventListener('keydown', function(e) {
|
| window.addEventListener('resize', function() {
|
| $('history-card-manager').closeMenu();
|
| });
|
| +
|
| +// Chrome Callbacks-------------------------------------------------------------
|
| +
|
| +/**
|
| + * Our history system calls this function with results from searches.
|
| + * @param {HistoryQuery} info An object containing information about the query.
|
| + * @param {Array<HistoryEntry>} results A list of results.
|
| + */
|
| +function historyResult(info, results) {
|
| + $('history-card-manager').addNewResults(results);
|
| +}
|
| +
|
| +/**
|
| + * Called by the history backend when deletion was succesful.
|
| + */
|
| +function deleteComplete() {
|
| + $('history-card-manager').removeDeletedHistory($('toolbar').count);
|
| + $('toolbar').count = 0;
|
| +}
|
| +
|
| +/**
|
| + * Called by the history backend when the deletion failed.
|
| + */
|
| +function deleteFailed() {
|
| +}
|
| +
|
| +/**
|
| + * Called when the history is deleted by someone else.
|
| + */
|
| +function historyDeleted() {
|
| +}
|
|
|