| OLD | NEW |
| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // If no external thumbnail fallback (etfb), and have domain. | 49 // If no external thumbnail fallback (etfb), and have domain. |
| 50 if (!params.etfb && data.domain) { | 50 if (!params.etfb && data.domain) { |
| 51 showDomainElement(); | 51 showDomainElement(); |
| 52 } else { | 52 } else { |
| 53 showEmptyTile(); | 53 showEmptyTile(); |
| 54 } | 54 } |
| 55 }; | 55 }; |
| 56 image.src = src; | 56 image.src = src; |
| 57 } | 57 } |
| 58 | 58 |
| 59 var useIcons = params['icons'] == '1'; | |
| 60 if (data.dummy) { | 59 if (data.dummy) { |
| 61 showEmptyTile(); | 60 showEmptyTile(); |
| 62 } else if (useIcons && data.largeIconUrl) { | 61 } else if (data.thumbnailUrls && data.thumbnailUrls.length) { |
| 63 createThumbnail(data.largeIconUrl, 'large-icon'); | |
| 64 } else if (!useIcons && data.thumbnailUrls && data.thumbnailUrls.length) { | |
| 65 createThumbnail(data.thumbnailUrls[0], 'thumbnail'); | 62 createThumbnail(data.thumbnailUrls[0], 'thumbnail'); |
| 66 } else if (data.domain) { | 63 } else if (data.domain) { |
| 67 showDomainElement(); | 64 showDomainElement(); |
| 68 } else { | 65 } else { |
| 69 showEmptyTile(); | 66 showEmptyTile(); |
| 70 } | 67 } |
| 71 }); | 68 }); |
| 72 }); | 69 }); |
| OLD | NEW |