Bug 1255767 - ToolbarDisplayLayout: Only use baseDomain if it is available. r=margaret, a=ritu
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 14 Mar 2016 12:24:47 +0100
changeset 323552 680d97831b6211e6e4637210626de1bf5fe3fcd6
parent 323551 77d83926c43db009ed98d9e29f79619be0fda04e
child 323553 dbb7628d3963eed482f055a8921429163162ee36
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, ritu
bugs1255767
milestone47.0a2
Bug 1255767 - ToolbarDisplayLayout: Only use baseDomain if it is available. r=margaret, a=ritu MozReview-Commit-ID: 6RXVwv9aN1K
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -300,16 +300,21 @@ public class ToolbarDisplayLayout extend
 
         final SpannableString spannable = new SpannableString(title);
         spannable.setSpan(mCertificateOwnerColorSpan, 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
 
         setTitle(spannable);
     }
 
     private void updateAndColorTitleFromFullURL(String url, String baseDomain, boolean isPrivate) {
+        if (TextUtils.isEmpty(baseDomain)) {
+            setTitle(url);
+            return;
+        }
+
         int index = url.indexOf(baseDomain);
         if (index == -1) {
             setTitle(url);
             return;
         }
 
         final SpannableStringBuilder builder = new SpannableStringBuilder(url);