Index: chrome/browser/resources/local_ntp/most_visited_single.js |
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.js b/chrome/browser/resources/local_ntp/most_visited_single.js |
index 2d719ff700fa81e6a528c5b66f6e2cb5e687ee47..8590dca1fa174462c9bcac6e96c8ec4492db88e3 100644 |
--- a/chrome/browser/resources/local_ntp/most_visited_single.js |
+++ b/chrome/browser/resources/local_ntp/most_visited_single.js |
@@ -47,18 +47,25 @@ var LOG_TYPE = { |
/** |
- * Whether to use icons instead of thumbnails. |
+ * Total number of tiles to show at any time. If the host page doesn't send |
+ * enough tiles, we fill them blank. |
* @const {number} |
*/ |
+var NUMBER_OF_TILES = 8; |
+ |
+ |
+/** |
+ * Whether to use icons instead of thumbnails. |
+ * @type {boolean} |
+ */ |
var USE_ICONS = false; |
/** |
- * Total number of tiles to show at any time. If the host page doesn't send |
- * enough tiles, we fill them blank. |
- * @const {number} |
+ * Number of lines to display in titles. |
+ * @type {number} |
*/ |
-var NUMBER_OF_TILES = 8; |
+var NUM_TITLE_LINES = 1; |
/** |
@@ -345,6 +352,9 @@ var renderTile = function(data) { |
var title = tile.querySelector('.mv-title'); |
title.innerText = data.title; |
title.style.direction = data.direction || 'ltr'; |
+ if (NUM_TITLE_LINES > 1) { |
fserb
2015/04/07 17:25:13
How is this supposed to work?
It doesn't matter th
huangs
2015/04/07 17:28:22
It's number of lines per title. Single line title
|
+ title.classList.add('multiline'); |
+ } |
var hasIcon = USE_ICONS && data.largeIconUrl; |
var hasThumb = !USE_ICONS && data.thumbnailUrl; |
@@ -427,6 +437,12 @@ var init = function() { |
// Apply class for icon NTP, if specified. |
USE_ICONS = queryArgs['icons'] == '1'; |
+ if ('ntl' in queryArgs) { |
+ var ntl = parseInt(queryArgs['ntl'], 10); |
+ if (isFinite(ntl)) |
+ NUM_TITLE_LINES = ntl; |
+ } |
+ |
// Duplicating NTP_DESIGN.mainClass. |
document.querySelector('#most-visited').classList.add( |
USE_ICONS ? 'icon-ntp' : 'thumb-ntp'); |