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

Unified Diff: chrome/browser/resources/local_ntp/most_visited_single.js

Issue 1134513005: Adds support for DELETE,BACKSPACE,ENTER,SPACE keys on single iframe ntp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/local_ntp/most_visited_single.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.js b/chrome/browser/resources/local_ntp/most_visited_single.js
index ce9fb8100b7e53b495c064bf160e9f8060f29439..46d2897eb3a7f6a886cdf2073eea2bbb82960c44 100644
--- a/chrome/browser/resources/local_ntp/most_visited_single.js
+++ b/chrome/browser/resources/local_ntp/most_visited_single.js
@@ -338,11 +338,16 @@ var renderTile = function(data) {
tile.href = data.url;
tile.title = data.title;
- tile.addEventListener('keypress', function(ev) {
- if (ev.keyCode == 127) { // DELETE
+ tile.addEventListener('keydown', function(event) {
+ if (event.keyCode == 46 /* DELETE */ ||
+ event.keyCode == 8 /* BACKSPACE */) {
+ event.preventDefault();
+ event.stopPropagation();
blacklistTile(tile);
- ev.stopPropagation();
- return false;
+ } else if (event.keyCode == 13 /* ENTER */ ||
+ event.keyCode == 32 /* SPACE */) {
+ event.preventDefault();
+ tile.click();
}
});
// TODO(fserb): remove this or at least change to mouseenter.
« 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