| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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('ntp4', function() { | 5 cr.define('ntp4', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 var TilePage = ntp4.TilePage; | 8 var TilePage = ntp4.TilePage; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 maxTileWidth: 214, | 252 maxTileWidth: 214, |
| 253 }; | 253 }; |
| 254 TilePage.initGridValues(mostVisitedPageGridValues); | 254 TilePage.initGridValues(mostVisitedPageGridValues); |
| 255 | 255 |
| 256 /** | 256 /** |
| 257 * Calculates the height for a Most Visited tile for a given width. The size | 257 * Calculates the height for a Most Visited tile for a given width. The size |
| 258 * is based on the thumbnail, which should have a 212:132 ratio. | 258 * is based on the thumbnail, which should have a 212:132 ratio. |
| 259 * @return {number} The height. | 259 * @return {number} The height. |
| 260 */ | 260 */ |
| 261 function heightForWidth(width) { | 261 function heightForWidth(width) { |
| 262 // The 2s are for borders, the 23 is for the title. | 262 // The 2s are for borders, the 31 is for the title. |
| 263 return (width - 2) * 132 / 212 + 2 + 23; | 263 return (width - 2) * 132 / 212 + 2 + 31; |
| 264 } | 264 } |
| 265 | 265 |
| 266 var THUMBNAIL_COUNT = 8; | 266 var THUMBNAIL_COUNT = 8; |
| 267 | 267 |
| 268 /** | 268 /** |
| 269 * Creates a new MostVisitedPage object. | 269 * Creates a new MostVisitedPage object. |
| 270 * @constructor | 270 * @constructor |
| 271 * @extends {TilePage} | 271 * @extends {TilePage} |
| 272 */ | 272 */ |
| 273 function MostVisitedPage() { | 273 function MostVisitedPage() { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 if (tile) | 442 if (tile) |
| 443 tile.setStripeColor(color); | 443 tile.setStripeColor(color); |
| 444 }; | 444 }; |
| 445 | 445 |
| 446 return { | 446 return { |
| 447 MostVisitedPage: MostVisitedPage, | 447 MostVisitedPage: MostVisitedPage, |
| 448 refreshData: refreshData, | 448 refreshData: refreshData, |
| 449 setMostVisitedFaviconDominantColor: setMostVisitedFaviconDominantColor, | 449 setMostVisitedFaviconDominantColor: setMostVisitedFaviconDominantColor, |
| 450 }; | 450 }; |
| 451 }); | 451 }); |
| OLD | NEW |