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

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

Issue 1013173003: [Icons NTP] Make Local NTP render largeIconUrl instead of thumbnail, if available. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/resources/local_ntp/most_visited_thumbnail.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_ntp/most_visited_thumbnail.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_thumbnail.js b/chrome/browser/resources/local_ntp/most_visited_thumbnail.js
index 2c3e770702b85e8ed2cd2d105182cce47b83cde9..efa1150536341c0e821bc039e76d87b863b72d20 100644
--- a/chrome/browser/resources/local_ntp/most_visited_thumbnail.js
+++ b/chrome/browser/resources/local_ntp/most_visited_thumbnail.js
@@ -39,8 +39,11 @@ window.addEventListener('DOMContentLoaded', function() {
data.provider));
}
// Creates and adds an image.
- function createThumbnail(src) {
+ function createThumbnail(src, imageClass) {
var image = document.createElement('img');
+ if (imageClass) {
+ image.classList.add(imageClass);
+ }
image.onload = function() {
var link = createMostVisitedLink(
params, data.url, data.title, undefined, data.direction,
@@ -69,8 +72,11 @@ window.addEventListener('DOMContentLoaded', function() {
if (data.dummy) {
showEmptyTile();
logEvent(NTP_LOGGING_EVENT_TYPE.NTP_EXTERNAL_TILE);
+ } else if (data.largeIconUrl) {
+ createThumbnail(data.largeIconUrl, 'large-icon');
+ // TODO(huangs): Log event for large icons.
} else if (data.thumbnailUrl) {
- createThumbnail(data.thumbnailUrl);
+ createThumbnail(data.thumbnailUrl, 'thumbnail');
logEvent(NTP_LOGGING_EVENT_TYPE.NTP_THUMBNAIL_TILE);
} else if (data.domain) {
showDomainElement();
« no previous file with comments | « chrome/browser/resources/local_ntp/most_visited_thumbnail.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698