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

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

Issue 1915513002: Fixed invalid parameter used by most visited thumbnail. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added check for thumbnailUrls.length Created 4 years, 8 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 Rendering for iframed most visited thumbnails. 7 * @fileoverview Rendering for iframed most visited thumbnails.
8 */ 8 */
9 9
10 window.addEventListener('DOMContentLoaded', function() { 10 window.addEventListener('DOMContentLoaded', function() {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 image.src = src; 71 image.src = src;
72 } 72 }
73 73
74 var useIcons = params['icons'] == '1'; 74 var useIcons = params['icons'] == '1';
75 if (data.dummy) { 75 if (data.dummy) {
76 showEmptyTile(); 76 showEmptyTile();
77 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_EXTERNAL_TILE); 77 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_EXTERNAL_TILE);
78 } else if (useIcons && data.largeIconUrl) { 78 } else if (useIcons && data.largeIconUrl) {
79 createThumbnail(data.largeIconUrl, 'large-icon'); 79 createThumbnail(data.largeIconUrl, 'large-icon');
80 // TODO(huangs): Log event for large icons. 80 // TODO(huangs): Log event for large icons.
81 } else if (!useIcons && data.thumbnailUrl) { 81 } else if (!useIcons && data.thumbnailUrls && data.thumbnailUrls.length) {
82 createThumbnail(data.thumbnailUrl, 'thumbnail'); 82 createThumbnail(data.thumbnailUrls[0], 'thumbnail');
83 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_THUMBNAIL_TILE); 83 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_THUMBNAIL_TILE);
84 } else if (data.domain) { 84 } else if (data.domain) {
85 showDomainElement(); 85 showDomainElement();
86 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_GRAY_TILE); 86 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_GRAY_TILE);
87 } else { 87 } else {
88 showEmptyTile(); 88 showEmptyTile();
89 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_EXTERNAL_TILE); 89 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_EXTERNAL_TILE);
90 } 90 }
91 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_TILE); 91 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_TILE);
92 92
93 // Log an impression if we know the position of the tile. 93 // Log an impression if we know the position of the tile.
94 if (isFinite(params.pos) && data.provider) { 94 if (isFinite(params.pos) && data.provider) {
95 logMostVisitedImpression(parseInt(params.pos, 10), data.provider); 95 logMostVisitedImpression(parseInt(params.pos, 10), data.provider);
96 } 96 }
97 }); 97 });
98 }); 98 });
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