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

Unified Diff: chrome/browser/resources/local_ntp/most_visited_single.js

Issue 1029583003: [Icons NTP] Make Fast Local NTP render largeIconUrl instead of thumbnail, if available. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A bit of renaming to reduce ambiguity. Created 5 years, 9 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
Index: chrome/browser/resources/local_ntp/most_visited_single.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.js b/chrome/browser/resources/local_ntp/most_visited_single.js
index dcd7257035ca23e30b02aa5da3b24c92324cf4b0..811e5f457a7297aff37898bbc42861169c2b6d30 100644
--- a/chrome/browser/resources/local_ntp/most_visited_single.js
+++ b/chrome/browser/resources/local_ntp/most_visited_single.js
@@ -279,12 +279,23 @@ var renderTile = function(data) {
title.style.direction = data.direction || 'ltr';
var thumb = tile.querySelector('.mv-thumb');
- if (data.thumbnailUrl) {
+ if (data.largeIconUrl || data.thumbnailUrl) {
var img = document.createElement('img');
img.title = data.title;
- img.src = data.thumbnailUrl;
+ if (data.largeIconUrl) {
+ img.src = data.largeIconUrl;
+ img.classList.add('large-icon');
+ } else {
+ img.src = data.thumbnailUrl;
+ img.classList.add('thumbnail');
+ }
loadedCounter += 1;
img.addEventListener('load', countLoad);
+ if (data.largeIconUrl) {
+ img.addEventListener('load', function(ev) {
+ thumb.classList.add('large-icon-outer');
+ });
+ }
img.addEventListener('error', countLoad);
img.addEventListener('error', function(ev) {
thumb.classList.add('failed-img');

Powered by Google App Engine
This is Rietveld 408576698