Bug 1255767 - ToolbarDisplayLayout: Only use baseDomain if it is available. r=margaret.
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 14 Mar 2016 12:24:47 +0100
changeset 288534 53961d91a52be96a4f5b2d091206c3bfea3a680b
parent 288533 2c45f42f52c23249cae3c8c4b0c4859d6140fcb6
child 288535 201d6b255e36072ec586e73fe15c084b7b8e7728
push id18161
push users.kaspari@gmail.com
push dateMon, 14 Mar 2016 17:26:18 +0000
treeherderfx-team@53961d91a52b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1255767
milestone48.0a1
Bug 1255767 - ToolbarDisplayLayout: Only use baseDomain if it is available. r=margaret. 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);