Bug 1337264 - Don't depend on page title changes for updating the displayed URL. r?sebastian
We've been displaying the URL in place of the page title in the toolbar for quite some time now, but still had the old logic in place whereby only title changes would trigger an update of the displayed text. Most of the time this works fine, because
- page navigation usually goes hand in hand with a DOMTitleChanged event, and
- when our loading progress bar stops, we update the displayed text anyway
however a page doing its navigation in-place using some fancy JS logic and the corresponding history APIs etc. can bypass both of these provisions, since it might trigger neither a title change nor a full browser-side page load.
MozReview-Commit-ID: KRrTSmz1xxi
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
@@ -465,21 +465,20 @@ public abstract class BrowserToolbar ext
updateNavigationButtons(tab);
break;
case SELECTED:
flags.add(UpdateFlags.PRIVATE_MODE);
setPrivateMode(tab.isPrivate());
// Fall through.
case LOAD_ERROR:
+ case LOCATION_CHANGE:
+ // We're displaying the tab URL in place of the title,
+ // so we always need to update our "title" here as well.
flags.add(UpdateFlags.TITLE);
- // Fall through.
- case LOCATION_CHANGE:
- // A successful location change will cause Tab to notify
- // us of a title change, so we don't update the title here.
flags.add(UpdateFlags.FAVICON);
flags.add(UpdateFlags.SITE_IDENTITY);
updateNavigationButtons(tab);
break;
case TITLE:
flags.add(UpdateFlags.TITLE);