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

Unified Diff: chrome/browser/resources/history/history.js

Issue 643013002: history: fix delete regression when Delete is held down. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history/history.js
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index 0595624ce7da98933cc09aece710e831fc67cd7c..16f267cf7184ab175f1dd74961a9965666ceaaad 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -489,10 +489,8 @@ Visit.prototype.showMoreFromSite_ = function() {
*/
Visit.prototype.handleKeydown_ = function(e) {
// Delete or Backspace should delete the entry if allowed.
- if ((e.keyIdentifier == 'U+0008' || e.keyIdentifier == 'U+007F') &&
- !this.model_.isDeletingVisits()) {
+ if (e.keyIdentifier == 'U+0008' || e.keyIdentifier == 'U+007F')
this.removeEntryFromHistory_(e);
- }
};
/**
@@ -501,8 +499,10 @@ Visit.prototype.handleKeydown_ = function(e) {
* @private
*/
Visit.prototype.removeEntryFromHistory_ = function(e) {
- if (!this.model_.deletingHistoryAllowed)
+ if (!this.model_.deletingHistoryAllowed || this.model_.isDeletingVisits() ||
+ this.domNode_.classList.contains('fade-out')) {
return;
+ }
this.model_.getView().onBeforeRemove(this);
this.removeFromHistory();
@@ -1225,8 +1225,10 @@ HistoryView.prototype.removeVisit = function(visit) {
HistoryView.prototype.onEntryRemoved = function() {
this.updateSelectionEditButtons();
- if (this.model_.getSize() == 0)
+ if (this.model_.getSize() == 0) {
+ this.clear_();
this.onModelReady(true); // Shows "No entries" message.
+ }
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698