summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 17:33:56 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 17:33:56 +0000
commit156d2fadd7d203307723a816f195025b5c9ea926 (patch)
treea2ab74d6c8ee8edbe560e7bcfa42e8a875cdc169 /chrome/browser/resources
parenta20e3b0d860051038cb968b6fe2f253ebd817e7a (diff)
downloadchromium_src-156d2fadd7d203307723a816f195025b5c9ea926.zip
chromium_src-156d2fadd7d203307723a816f195025b5c9ea926.tar.gz
chromium_src-156d2fadd7d203307723a816f195025b5c9ea926.tar.bz2
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
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/new_tab.html16
1 files changed, 14 insertions, 2 deletions
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) {
<img class="thumbnail" style="background-image:url(thumbnailurl);" />
</a>
*/
- 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 = '&nbsp;';
+ }
root.appendChild(div_title);
root.appendChild(img_thumbnail);