Bug 1363049 - getNextTab() should only use parent tabs of the same type. r?walkingice draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 18 May 2017 20:45:22 +0200
changeset 581235 6bb4e62460161eab1acfb15336baa11204348f4b
parent 580580 c5ff832115ea2e53fe760b30e76f9c7e966c9e50
child 629529 3e5f0e1c9fe329250c9b1fe3167c03955178f445
push id59818
push usermozilla@buttercookie.de
push dateFri, 19 May 2017 15:16:40 +0000
reviewerswalkingice
bugs1363049
milestone55.0a1
Bug 1363049 - getNextTab() should only use parent tabs of the same type. r?walkingice That is if the currently selected tab has a web app or custom tab as its "parent tab", we'll ignore that fact when the tab is closed from the tabs tray, so we don't trigger an activity switch that way. MozReview-Commit-ID: 7bOi90RQUhA
mobile/android/base/java/org/mozilla/gecko/Tabs.java
--- a/mobile/android/base/java/org/mozilla/gecko/Tabs.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tabs.java
@@ -594,17 +594,17 @@ public class Tabs implements BundleEvent
         }
         if (nextTab == null && type != TabType.BROWSING) {
             // If there are no non-private tabs of the same type remaining,
             // fall back to TabType.BROWSING.
             nextTab = getFallbackNextTab(TabType.BROWSING);
         }
 
         Tab parent = getTab(tab.getParentId());
-        if (parent != null) {
+        if (parent != null && parent.getType() == type) {
             // If the next tab is a sibling, switch to it. Otherwise go back to the parent.
             if (nextTab != null && nextTab.getParentId() == tab.getParentId())
                 return nextTab;
             else
                 return parent;
         }
         return nextTab;
     }