Bug 1177124 - Doorhanger: Hide title/favicon if they don't exist. r=liuche
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 12 Aug 2015 15:30:57 +0200
changeset 257713 0bfda075f48486c4b6bdda5750cb307d59c1d3e9
parent 257712 a75f036fba8418e52c31d2b73a7c0e63d30536ac
child 257714 66d1159b02a6bdf908b8818b2bbc800c258626b9
push id14665
push users.kaspari@gmail.com
push dateFri, 14 Aug 2015 08:52:12 +0000
treeherderfx-team@0bfda075f484 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs1177124
milestone43.0a1
Bug 1177124 - Doorhanger: Hide title/favicon if they don't exist. r=liuche
mobile/android/base/DoorHangerPopup.java
--- a/mobile/android/base/DoorHangerPopup.java
+++ b/mobile/android/base/DoorHangerPopup.java
@@ -2,16 +2,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
 import java.util.HashSet;
 
+import android.text.TextUtils;
 import android.widget.PopupWindow;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.json.JSONArray;
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.widget.AnchoredPopup;
@@ -303,17 +304,23 @@ public class DoorHangerPopup extends Anc
         }
 
         showDividers();
         if (isShowing()) {
             show();
             return;
         }
 
-        firstDoorhanger.showTitle(tab.getFavicon(), tab.getBaseDomain());
+        final String baseDomain = tab.getBaseDomain();
+
+        if (TextUtils.isEmpty(baseDomain)) {
+            firstDoorhanger.hideTitle();
+        } else {
+            firstDoorhanger.showTitle(tab.getFavicon(), baseDomain);
+        }
 
         // Make the popup focusable for accessibility. This gets done here
         // so the node can be accessibility focused, but on pre-ICS devices this
         // causes crashes, so it is done after the popup is shown.
         if (Versions.feature14Plus) {
             setFocusable(true);
         }