Bug 1357778 - Exclude non browsing tabs in the TabStripView, too. r=walkingice
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 26 May 2017 20:15:27 +0200
changeset 409387 c1cc89fcaa05b414c2e6174a0a311da2d93148b2
parent 409295 f26f1c5652fca64191701d09fc49adf76e0c49a3
child 409388 9b891f690b989341cdd5116629a1ef60462c9e8a
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswalkingice
bugs1357778
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1357778 - Exclude non browsing tabs in the TabStripView, too. r=walkingice We're already doing this in the tab strip, but this presumably didn't cover the initialisation via TabStripView.refreshTabs(). MozReview-Commit-ID: Abdk1mD5HyZ
mobile/android/base/java/org/mozilla/gecko/tabs/TabStripView.java
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabStripView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabStripView.java
@@ -26,32 +26,37 @@ import android.support.v7.widget.helper.
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewTreeObserver;
 import android.view.animation.DecelerateInterpolator;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.mozilla.gecko.Tab.TabType;
+
 public class TabStripView extends RecyclerView
                           implements TabsTouchHelperCallback.DragListener {
     private static final int ANIM_TIME_MS = 200;
     private static final DecelerateInterpolator ANIM_INTERPOLATOR = new DecelerateInterpolator();
 
     private final TabStripAdapter adapter;
+    private final TabType type;
     private boolean isPrivate;
 
     private final TabAnimatorListener animatorListener;
 
     private final Paint fadingEdgePaint;
     private final int fadingEdgeSize;
 
     public TabStripView(Context context, AttributeSet attrs) {
         super(context, attrs);
 
+        type = TabType.BROWSING;
+
         fadingEdgePaint = new Paint();
         final Resources resources = getResources();
         fadingEdgeSize =
                 resources.getDimensionPixelOffset(R.dimen.tablet_tab_strip_fading_edge_size);
 
         animatorListener = new TabAnimatorListener();
 
         setChildrenDrawingOrderEnabled(true);
@@ -75,17 +80,17 @@ public class TabStripView extends Recycl
     }
 
     /* package */ void refreshTabs() {
         // Store a different copy of the tabs, so that we don't have
         // to worry about accidentally updating it on the wrong thread.
         final List<Tab> tabs = new ArrayList<>();
 
         for (final Tab tab : Tabs.getInstance().getTabsInOrder()) {
-            if (tab.isPrivate() == isPrivate) {
+            if (tab.isPrivate() == isPrivate && tab.getType() == type) {
                 tabs.add(tab);
             }
         }
 
         adapter.refresh(tabs);
         updateSelectedPosition();
     }
 
@@ -94,17 +99,17 @@ public class TabStripView extends Recycl
     }
 
     /* package */ void restoreTabs() {
         refreshTabs();
         animateRestoredTabs();
     }
 
     /* package */ void addTab(Tab tab, int position) {
-        if (tab.isPrivate() != isPrivate) {
+        if (tab.isPrivate() != isPrivate || tab.getType() != type) {
             return;
         }
 
         adapter.addTab(tab, position);
     }
 
     /* package */ void removeTab(Tab tab) {
         adapter.removeTab(tab);