Bug 689524 - Show title on tabs showing about:home (r=mbrubeck)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 28 Sep 2011 17:22:41 +0100
changeset 77770 fd799dc8611637c60143d5b1bf6a98d4c2bd071e
parent 77769 09d60465831c71dcf8dbc695d62c79b23b23f4e5
child 77771 638433a972a31d82060b30cb45db3a3e69f11fae
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmbrubeck
bugs689524
milestone10.0a1
Bug 689524 - Show title on tabs showing about:home (r=mbrubeck)
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -112,26 +112,28 @@ var BrowserUI = {
         Browser.selectedTab = Browser.tabs[i];
         break;
       }
     }
   },
 
   _titleChanged: function(aBrowser) {
     let url = this.getDisplayURI(aBrowser);
-    let caption = aBrowser.contentTitle || url;
+    let contentTitle = aBrowser.contentTitle;
+    let caption = contentTitle || url;
+    let tabCaption = contentTitle || (Util.isURLEmpty(url) ? "" : url);
 
-    if (aBrowser.contentTitle == "" && !Util.isURLEmpty(aBrowser.userTypedValue))
-      caption = aBrowser.userTypedValue;
+    if (contentTitle == "" && !Util.isURLEmpty(aBrowser.userTypedValue))
+      caption = tabCaption = aBrowser.userTypedValue;
     else if (Util.isURLEmpty(url))
       caption = "";
 
     let tab = Browser.getTabForBrowser(aBrowser);
     if (tab)
-      tab.chromeTab.updateTitle(caption);
+      tab.chromeTab.updateTitle(tabCaption);
 
     let browser = Browser.selectedBrowser;
     if (browser && aBrowser != browser)
       return;
 
     if (caption) {
       this._title.value = caption;
       this._title.classList.remove("placeholder");