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

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

Issue 6410121: NTP: Fix restore all (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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/new_new_tab.js
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 381163dc39da750b389c0b7f493220ebc1cc07e7..eb425d5a363f3dace101728d178908914a4a0c5f 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -1027,14 +1027,18 @@ function hideNotification() {
var actionLink = notificationElement.querySelector('#actionlink');
var closeButton = notificationElement.querySelector('#notification-close');
// Prevent tabbing to the hidden link.
- actionLink.tabIndex = -1;
- closeButton.tabIndex = -1;
// Setting tabIndex to -1 only prevents future tabbing to it. If, however, the
// user switches window or a tab and then moves back to this tab the element
// may gain focus. We therefore make sure that we blur the element so that the
// element focus is not restored when coming back to this window.
- actionLink.blur();
- closeButton.blur();
+ if (actionLink) {
+ actionLink.tabIndex = -1;
+ actionLink.blur();
+ }
+ if (closeButton) {
+ closeButton.tabIndex = -1;
+ closeButton.blur();
+ }
}
function showFirstRunNotification() {
« 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