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

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

Issue 569613003: [New Tab Page] Add aria-hidden to an element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 5
6 /** 6 /**
7 * @fileoverview The local InstantExtended NTP. 7 * @fileoverview The local InstantExtended NTP.
8 */ 8 */
9 9
10 10
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 if (NTP_DESIGN.thumbnailFallback) { 718 if (NTP_DESIGN.thumbnailFallback) {
719 var fallbackElem = createAndAppendElement( 719 var fallbackElem = createAndAppendElement(
720 innerElem, 'div', CLASSES.THUMBNAIL_FALLBACK); 720 innerElem, 'div', CLASSES.THUMBNAIL_FALLBACK);
721 if (NTP_DESIGN.thumbnailFallback === THUMBNAIL_FALLBACK.DOT) 721 if (NTP_DESIGN.thumbnailFallback === THUMBNAIL_FALLBACK.DOT)
722 createAndAppendElement(fallbackElem, 'div', CLASSES.DOT); 722 createAndAppendElement(fallbackElem, 'div', CLASSES.DOT);
723 } 723 }
724 724
725 // The iframe which renders either a thumbnail or domain element. 725 // The iframe which renders either a thumbnail or domain element.
726 var thumbnailElem = document.createElement('iframe'); 726 var thumbnailElem = document.createElement('iframe');
727 thumbnailElem.tabIndex = '-1'; 727 thumbnailElem.tabIndex = '-1';
728 thumbnailElem.setAttribute('aria-hidden', 'true');
728 // Keep this ID here. See comment above. 729 // Keep this ID here. See comment above.
729 thumbnailElem.id = 'thumb-' + rid; 730 thumbnailElem.id = 'thumb-' + rid;
730 thumbnailElem.className = CLASSES.THUMBNAIL; 731 thumbnailElem.className = CLASSES.THUMBNAIL;
731 thumbnailElem.src = getMostVisitedThumbnailIframeUrl(rid, position); 732 thumbnailElem.src = getMostVisitedThumbnailIframeUrl(rid, position);
732 innerElem.appendChild(thumbnailElem); 733 innerElem.appendChild(thumbnailElem);
733 734
734 // The button used to blacklist this page. 735 // The button used to blacklist this page.
735 var blacklistButton = createAndAppendElement( 736 var blacklistButton = createAndAppendElement(
736 innerElem, 'div', CLASSES.BLACKLIST_BUTTON); 737 innerElem, 'div', CLASSES.BLACKLIST_BUTTON);
737 createAndAppendElement( 738 createAndAppendElement(
(...skipping 18 matching lines...) Expand all
756 } else { 757 } else {
757 return new Tile(tileElem); 758 return new Tile(tileElem);
758 } 759 }
759 } 760 }
760 761
761 762
762 /** 763 /**
763 * Generates a function to be called when the page with the corresponding RID 764 * Generates a function to be called when the page with the corresponding RID
764 * is blacklisted. 765 * is blacklisted.
765 * @param {number} rid The RID of the page being blacklisted. 766 * @param {number} rid The RID of the page being blacklisted.
766 * @return {function(!Event)} A function which handles the blacklisting of the 767 * @return {function(Event=)} A function which handles the blacklisting of the
767 * page by updating state variables and notifying Chrome. 768 * page by updating state variables and notifying Chrome.
768 */ 769 */
769 function generateBlacklistFunction(rid) { 770 function generateBlacklistFunction(rid) {
770 return function(e) { 771 return function(e) {
771 // Prevent navigation when the page is being blacklisted. 772 // Prevent navigation when the page is being blacklisted.
772 if (e) 773 if (e)
773 e.stopPropagation(); 774 e.stopPropagation();
774 775
775 userInitiatedMostVisitedChange = true; 776 userInitiatedMostVisitedChange = true;
776 isBlacklisting = true; 777 isBlacklisting = true;
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 1196
1196 return { 1197 return {
1197 init: init, 1198 init: init,
1198 listen: listen 1199 listen: listen
1199 }; 1200 };
1200 } 1201 }
1201 1202
1202 if (!window.localNTPUnitTest) { 1203 if (!window.localNTPUnitTest) {
1203 LocalNTP().listen(); 1204 LocalNTP().listen();
1204 } 1205 }
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