From 156d2fadd7d203307723a816f195025b5c9ea926 Mon Sep 17 00:00:00 2001 From: "evanm@google.com" Date: Tue, 29 Jul 2008 17:33:56 +0000 Subject: Make the new tab thumbnail slighly less confusing -- laid out properly, but unclickable -- when something goes wrong and the page is fed garbage input. (I don't expect new users will ever see this, but migration bugs in previous versions have made this a recurring problem.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/resources/new_tab.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/resources/new_tab.html b/chrome/browser/resources/new_tab.html index 133b8b6..fed6f9e 100644 --- a/chrome/browser/resources/new_tab.html +++ b/chrome/browser/resources/new_tab.html @@ -419,7 +419,14 @@ function makeMostVisitedDOM(page) { */ - var root = DOM('a', {href:page.url, className:'most-visited-item', title:page.title}); + var root; + if (page.url) { + root = DOM('a', {href:page.url, title:page.title}); + } else { + // Something went wrong; don't make it clickable. + root = DOM('span'); + } + /* Create the thumbnail */ var img_thumbnail = DOM('img', {className:'thumbnail'}); @@ -430,7 +437,12 @@ function makeMostVisitedDOM(page) { var div_title = DOM('div', {className:'thumbnail-title'}); div_title.style.backgroundImage = 'url("chrome-resource://favicon/' + page.url + '")'; - div_title.appendChild(document.createTextNode(page.title)); + if (page.title) { + div_title.appendChild(document.createTextNode(page.title)); + } else { + // Make the empty title at least push down the icon. + div_title.innerHTML = ' '; + } root.appendChild(div_title); root.appendChild(img_thumbnail); -- cgit v1.1