diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 17:56:55 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-19 17:56:55 +0000 |
commit | a8099142a1a8b4fee2136669eb7ab41868e4e7a0 (patch) | |
tree | 4aedb2c87068cb7fa51262d02940a5394edb1cd4 | |
parent | 25ce9fe1732a2940bea277b723c354349c5bb16d (diff) | |
download | chromium_src-a8099142a1a8b4fee2136669eb7ab41868e4e7a0.zip chromium_src-a8099142a1a8b4fee2136669eb7ab41868e4e7a0.tar.gz chromium_src-a8099142a1a8b4fee2136669eb7ab41868e4e7a0.tar.bz2 |
Show the URL when there's no title in the DOMUI prefs start-page dialog
See chromium-os bug 9009.
BUG=None
TEST=Add start page in DOMUI options; if there's no title for a page, the URL should be displayed.
Review URL: http://codereview.chromium.org/5162005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66771 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/options/add_startup_page_recent_pages_list.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/resources/options/add_startup_page_recent_pages_list.js b/chrome/browser/resources/options/add_startup_page_recent_pages_list.js index 8e7df7f..033f244 100644 --- a/chrome/browser/resources/options/add_startup_page_recent_pages_list.js +++ b/chrome/browser/resources/options/add_startup_page_recent_pages_list.js @@ -38,16 +38,19 @@ cr.define('options.add_startup_page', function() { var titleEl = this.ownerDocument.createElement('span'); titleEl.className = 'title'; titleEl.classList.add('favicon-cell'); - titleEl.textContent = this.pageInfo['title']; titleEl.style.backgroundImage = url('chrome://favicon/' + this.pageInfo['url']); - - var urlEL = this.ownerDocument.createElement('span'); - urlEL.className = 'url'; - urlEL.textContent = this.pageInfo['displayURL']; - this.appendChild(titleEl); - this.appendChild(urlEL); + if (this.pageInfo['title'].length > 0) { + titleEl.textContent = this.pageInfo['title']; + + var urlEL = this.ownerDocument.createElement('span'); + urlEL.className = 'url'; + urlEL.textContent = this.pageInfo['displayURL']; + this.appendChild(urlEL); + } else { + titleEl.textContent = this.pageInfo['displayURL']; + } }, }; |