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

Side by Side Diff: chrome/browser/resources/new_new_tab.js

Issue 6579022: Merge 74015 - NTP: Fix restore all... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more 5 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more
6 // than this many items in the miniview. 6 // than this many items in the miniview.
7 var MAX_MINIVIEW_ITEMS = 15; 7 var MAX_MINIVIEW_ITEMS = 15;
8 8
9 // Extra spacing at the top of the layout. 9 // Extra spacing at the top of the layout.
10 var LAYOUT_SPACING_TOP = 25; 10 var LAYOUT_SPACING_TOP = 25;
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 /** 1020 /**
1021 * Hides the notifier. 1021 * Hides the notifier.
1022 */ 1022 */
1023 function hideNotification() { 1023 function hideNotification() {
1024 var notificationElement = $('notification'); 1024 var notificationElement = $('notification');
1025 notificationElement.classList.remove('show'); 1025 notificationElement.classList.remove('show');
1026 document.body.classList.remove('notification-shown'); 1026 document.body.classList.remove('notification-shown');
1027 var actionLink = notificationElement.querySelector('#actionlink'); 1027 var actionLink = notificationElement.querySelector('#actionlink');
1028 var closeButton = notificationElement.querySelector('#notification-close'); 1028 var closeButton = notificationElement.querySelector('#notification-close');
1029 // Prevent tabbing to the hidden link. 1029 // Prevent tabbing to the hidden link.
1030 actionLink.tabIndex = -1;
1031 closeButton.tabIndex = -1;
1032 // Setting tabIndex to -1 only prevents future tabbing to it. If, however, the 1030 // Setting tabIndex to -1 only prevents future tabbing to it. If, however, the
1033 // user switches window or a tab and then moves back to this tab the element 1031 // user switches window or a tab and then moves back to this tab the element
1034 // may gain focus. We therefore make sure that we blur the element so that the 1032 // may gain focus. We therefore make sure that we blur the element so that the
1035 // element focus is not restored when coming back to this window. 1033 // element focus is not restored when coming back to this window.
1036 actionLink.blur(); 1034 if (actionLink) {
1037 closeButton.blur(); 1035 actionLink.tabIndex = -1;
1036 actionLink.blur();
1037 }
1038 if (closeButton) {
1039 closeButton.tabIndex = -1;
1040 closeButton.blur();
1041 }
1038 } 1042 }
1039 1043
1040 function showFirstRunNotification() { 1044 function showFirstRunNotification() {
1041 showNotification(localStrings.getString('firstrunnotification'), 1045 showNotification(localStrings.getString('firstrunnotification'),
1042 null, null, 30000); 1046 null, null, 30000);
1043 var notificationElement = $('notification'); 1047 var notificationElement = $('notification');
1044 notification.classList.add('first-run'); 1048 notification.classList.add('first-run');
1045 } 1049 }
1046 1050
1047 function showPromoNotification() { 1051 function showPromoNotification() {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 var promoLink = document.querySelector('#apps-promo-text1 a'); 1437 var promoLink = document.querySelector('#apps-promo-text1 a');
1434 promoLink.id = 'apps-promo-link'; 1438 promoLink.id = 'apps-promo-link';
1435 promoLink.href = localStrings.getString('web_store_url'); 1439 promoLink.href = localStrings.getString('web_store_url');
1436 1440
1437 $('apps-promo-hide').addEventListener('click', function() { 1441 $('apps-promo-hide').addEventListener('click', function() {
1438 chrome.send('hideAppsPromo', []); 1442 chrome.send('hideAppsPromo', []);
1439 document.documentElement.classList.remove('apps-promo-visible'); 1443 document.documentElement.classList.remove('apps-promo-visible');
1440 layoutSections(); 1444 layoutSections();
1441 }); 1445 });
1442 }); 1446 });
OLDNEW
« 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