Chromium Code Reviews| Index: chrome/browser/resources/local_ntp/most_visited_util.js |
| diff --git a/chrome/browser/resources/local_ntp/most_visited_util.js b/chrome/browser/resources/local_ntp/most_visited_util.js |
| index 430917941438949c32dad5578af08ba5ce3c5e69..5cdd50cf8597fad429bad79d6132353589a2f00a 100644 |
| --- a/chrome/browser/resources/local_ntp/most_visited_util.js |
| +++ b/chrome/browser/resources/local_ntp/most_visited_util.js |
| @@ -123,15 +123,28 @@ function createMostVisitedLink(params, href, title, text, direction, provider) { |
| link.href = href; |
| link.title = title; |
| link.target = '_top'; |
| - // Exclude links from the tab order. The tabIndex is added to the thumbnail |
| - // parent container instead. |
| - link.tabIndex = '-1'; |
| + // Include links in the tab order. The tabIndex is necessary for |
| + // accessibility. |
| + link.tabIndex = '0'; |
| if (text) |
| link.textContent = text; |
| link.addEventListener('mouseover', function() { |
| var ntpApiHandle = chrome.embeddedSearch.newTabPage; |
| ntpApiHandle.logEvent(NTP_LOGGING_EVENT_TYPE.NTP_MOUSEOVER); |
| }); |
| + link.addEventListener('focus', function() { |
| + window.parent.postMessage('linkFocused', DOMAIN_ORIGIN); |
| + }); |
| + link.addEventListener('blur', function() { |
| + window.parent.postMessage('linkBlurred', DOMAIN_ORIGIN); |
| + }); |
| + link.addEventListener('keydown', function(event) { |
| + if (event.keyCode == 46 /* DELETE */ || |
|
huangs
2014/09/11 20:31:41
Need to handle ENTER, perhaps.
Mathieu
2014/09/11 20:54:10
Done.
|
| + event.keyCode == 8 /* BACKSPACE */) { |
| + event.preventDefault(); |
| + window.parent.postMessage('tileBlacklisted,' + params.pos, DOMAIN_ORIGIN); |
| + } |
| + }); |
| // Webkit's security policy prevents some Most Visited thumbnails from |
| // working (those with schemes different from http and https). Therefore, |