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

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

Issue 2305723002: local ntp: fix up accessibility tree (Closed)
Patch Set: Created 4 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 2015 The Chromium Authors. All rights reserved. 1 /* Copyright 2015 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 // Single iframe for NTP tiles. 5 // Single iframe for NTP tiles.
6 (function() { 6 (function() {
7 'use strict'; 7 'use strict';
8 8
9 9
10 /** 10 /**
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 var position = tiles.children.length; 372 var position = tiles.children.length;
373 logMostVisitedImpression(position, data.tileSource); 373 logMostVisitedImpression(position, data.tileSource);
374 374
375 tile.className = 'mv-tile'; 375 tile.className = 'mv-tile';
376 tile.setAttribute('data-tid', data.tid); 376 tile.setAttribute('data-tid', data.tid);
377 var html = []; 377 var html = [];
378 if (!USE_ICONS) { 378 if (!USE_ICONS) {
379 html.push('<div class="mv-favicon"></div>'); 379 html.push('<div class="mv-favicon"></div>');
380 } 380 }
381 html.push('<div class="mv-title"></div><div class="mv-thumb"></div>'); 381 html.push('<div class="mv-title"></div><div class="mv-thumb"></div>');
382 html.push('<div class="mv-x"></div>'); 382 html.push('<div class="mv-x" role="button"></div>');
383 tile.innerHTML = html.join(''); 383 tile.innerHTML = html.join('');
384 tile.lastElementChild.title = queryArgs['removeTooltip'] || ''; 384 tile.lastElementChild.title = queryArgs['removeTooltip'] || '';
385 385
386 if (isSchemeAllowed(data.url)) { 386 if (isSchemeAllowed(data.url)) {
387 tile.href = data.url; 387 tile.href = data.url;
388 } 388 }
389 tile.setAttribute('aria-label', data.title);
389 tile.title = data.title; 390 tile.title = data.title;
390 if (data.impressionUrl) { 391 if (data.impressionUrl) {
391 impressionUrl = data.impressionUrl; 392 impressionUrl = data.impressionUrl;
392 } 393 }
393 if (data.pingUrl) { 394 if (data.pingUrl) {
394 tile.addEventListener('click', function(ev) { 395 tile.addEventListener('click', function(ev) {
395 navigator.sendBeacon(data.pingUrl); 396 navigator.sendBeacon(data.pingUrl);
396 }); 397 });
397 } 398 }
398 399
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 var html = document.querySelector('html'); 611 var html = document.querySelector('html');
611 html.dir = 'rtl'; 612 html.dir = 'rtl';
612 } 613 }
613 614
614 window.addEventListener('message', handlePostMessage); 615 window.addEventListener('message', handlePostMessage);
615 }; 616 };
616 617
617 618
618 window.addEventListener('DOMContentLoaded', init); 619 window.addEventListener('DOMContentLoaded', init);
619 })(); 620 })();
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