| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 this.reset(); | 88 this.reset(); |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 | 91 |
| 92 var id = tileID++; | 92 var id = tileID++; |
| 93 this.id = 'suggestions-tile-' + id; | 93 this.id = 'suggestions-tile-' + id; |
| 94 this.data_ = data; | 94 this.data_ = data; |
| 95 this.classList.add('focusable'); | 95 this.classList.add('focusable'); |
| 96 | 96 |
| 97 var faviconDiv = this.querySelector('.favicon'); | 97 var faviconDiv = this.querySelector('.favicon'); |
| 98 var faviconUrl = 'chrome://favicon/size/16/' + data.url; | 98 var faviconUrl = 'chrome://favicon/size/16@1x/' + data.url; |
| 99 faviconDiv.style.backgroundImage = url(faviconUrl); | 99 faviconDiv.style.backgroundImage = url(faviconUrl); |
| 100 chrome.send('getFaviconDominantColor', [faviconUrl, this.id]); | 100 chrome.send('getFaviconDominantColor', [faviconUrl, this.id]); |
| 101 | 101 |
| 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 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 return oldData; | 465 return oldData; |
| 466 } | 466 } |
| 467 | 467 |
| 468 return { | 468 return { |
| 469 SuggestionsPage: SuggestionsPage, | 469 SuggestionsPage: SuggestionsPage, |
| 470 refreshData: refreshData, | 470 refreshData: refreshData, |
| 471 }; | 471 }; |
| 472 }); | 472 }); |
| 473 | 473 |
| 474 document.addEventListener('ntpLoaded', ntp.SuggestionsPage.onLoaded); | 474 document.addEventListener('ntpLoaded', ntp.SuggestionsPage.onLoaded); |
| OLD | NEW |