Bug 834525: Tab is not selected if its private. [r=mfinkle] [a=bbajaj]
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 30 Jan 2013 12:01:55 -0800
changeset 127383 52c22881fcc4d6e212eb9277625eff2edba19a7c
parent 127382 78d15d0bdb0d3c25a7bee54f122d14684385ad82
child 127384 af947a1a7dd398c0da6c8f12fa7517b16420e3be
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, bbajaj
bugs834525
milestone20.0a2
Bug 834525: Tab is not selected if its private. [r=mfinkle] [a=bbajaj]
mobile/android/base/TabsTray.java
mobile/android/base/resources/layout/tabs_panel.xml.in
--- a/mobile/android/base/TabsTray.java
+++ b/mobile/android/base/TabsTray.java
@@ -186,20 +186,18 @@ public class TabsTray extends ListView
 
             notifyDataSetChanged(); // Be sure to call this whenever mTabs changes.
             updateSelectedPosition();
         }
 
         // Updates the selected position in the list so that it will be scrolled to the right place.
         private void updateSelectedPosition() {
             int selected = getPositionForTab(Tabs.getInstance().getSelectedTab());
-            if (selected == -1)
-                return;
-
-            TabsTray.this.setItemChecked(selected, true);
+            for (int i=0; i < getCount(); i++)
+                 TabsTray.this.setItemChecked(i, (i == selected));
         }
 
         public void clear() {
             mTabs = null;
             notifyDataSetChanged(); // Be sure to call this whenever mTabs changes.
         }
 
         public int getCount() {
--- a/mobile/android/base/resources/layout/tabs_panel.xml.in
+++ b/mobile/android/base/resources/layout/tabs_panel.xml.in
@@ -38,16 +38,17 @@
                                     android:choiceMode="singleChoice"
                                     android:visibility="gone"
                                     gecko:tabs="tabs_normal"/>
 
         <org.mozilla.gecko.TabsTray android:id="@+id/private_tabs"
                                     style="@style/TabsList"
                                     android:layout_width="fill_parent"
                                     android:layout_height="fill_parent"
+                                    android:choiceMode="singleChoice"
                                     android:visibility="gone"
                                     gecko:tabs="tabs_private"/>
 
         <org.mozilla.gecko.RemoteTabs android:id="@+id/synced_tabs"
                                       style="@style/RemoteTabsList"
                                       android:layout_width="fill_parent"
                                       android:layout_height="fill_parent"
                                       android:visibility="gone"