OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('ntp', function() { | 5 cr.define('ntp', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var TilePage = ntp.TilePage; | 8 var TilePage = ntp.TilePage; |
9 | 9 |
10 /** | 10 /** |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 var title = this.querySelector('.title'); | 102 var title = this.querySelector('.title'); |
103 title.textContent = data.title; | 103 title.textContent = data.title; |
104 title.dir = data.direction; | 104 title.dir = data.direction; |
105 | 105 |
106 var score = this.querySelector('.score'); | 106 var score = this.querySelector('.score'); |
107 score.textContent = data.score; | 107 score.textContent = data.score; |
108 | 108 |
109 // Sets the tooltip. | 109 // Sets the tooltip. |
110 this.title = data.title; | 110 this.title = data.title; |
111 | 111 |
112 var thumbnailUrl = 'chrome://thumb/' + data.url; | 112 var thumbnailUrl; |
| 113 thumbnailUrl = data.urlImage ? data.urlImage : |
| 114 'chrome://thumb/' + data.url; |
| 115 |
113 this.querySelector('.thumbnail').style.backgroundImage = | 116 this.querySelector('.thumbnail').style.backgroundImage = |
114 url(thumbnailUrl); | 117 url(thumbnailUrl); |
115 | 118 |
116 this.href = data.url; | 119 this.href = data.url; |
117 | 120 |
118 this.classList.remove('filler'); | 121 this.classList.remove('filler'); |
119 }, | 122 }, |
120 | 123 |
121 /** | 124 /** |
122 * Sets the color of the favicon dominant color bar. | 125 * Sets the color of the favicon dominant color bar. |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 return oldData; | 465 return oldData; |
463 } | 466 } |
464 | 467 |
465 return { | 468 return { |
466 SuggestionsPage: SuggestionsPage, | 469 SuggestionsPage: SuggestionsPage, |
467 refreshData: refreshData, | 470 refreshData: refreshData, |
468 }; | 471 }; |
469 }); | 472 }); |
470 | 473 |
471 document.addEventListener('ntpLoaded', ntp.SuggestionsPage.onLoaded); | 474 document.addEventListener('ntpLoaded', ntp.SuggestionsPage.onLoaded); |
OLD | NEW |