Bug 1028337 - Fix crash when closing all private tabs. r=margaret
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 23 Jun 2014 11:01:37 -0700
changeset 190183 78ffdbef077c1a1c62d2a9570838dccb0c908696
parent 190182 b4cbfab9148b7692d4c7c0eba8d0836666743120
child 190184 55b0aa2da501b7999b09e168f203cad29f7233ca
push id27002
push userkwierso@gmail.com
push dateTue, 24 Jun 2014 00:56:44 +0000
treeherdermozilla-central@fa6a7a2f476c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1028337
milestone33.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 1028337 - Fix crash when closing all private tabs. r=margaret
mobile/android/base/tabspanel/PrivateTabsPanel.java
mobile/android/base/tabspanel/TabsPanel.java
mobile/android/base/tabspanel/TabsTray.java
--- a/mobile/android/base/tabspanel/PrivateTabsPanel.java
+++ b/mobile/android/base/tabspanel/PrivateTabsPanel.java
@@ -5,31 +5,31 @@
 
 package org.mozilla.gecko.tabspanel;
 
 import java.util.Locale;
 
 import org.mozilla.gecko.BrowserLocaleManager;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Tabs;
-import org.mozilla.gecko.tabspanel.TabsPanel.PanelView;
+import org.mozilla.gecko.tabspanel.TabsPanel.CloseAllPanelView;
 
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.FrameLayout;
 
 /**
  * A container that wraps the private tabs {@link android.widget.AdapterView} and empty
  * {@link android.view.View} to manage both of their visibility states by changing the visibility of
  * this container as calling {@link android.widget.AdapterView#setVisibility} does not affect the
  * empty View's visibility.
  */
-class PrivateTabsPanel extends FrameLayout implements PanelView {
+class PrivateTabsPanel extends FrameLayout implements CloseAllPanelView {
     private TabsPanel tabsPanel;
     private TabsTray tabsTray;
 
     public PrivateTabsPanel(Context context, AttributeSet attrs) {
         super(context, attrs);
 
         LayoutInflater.from(context).inflate(R.layout.private_tabs_panel, this);
         tabsTray = (TabsTray) findViewById(R.id.private_tabs_tray);
@@ -69,9 +69,14 @@ class PrivateTabsPanel extends FrameLayo
         setVisibility(View.GONE);
         tabsTray.hide();
     }
 
     @Override
     public boolean shouldExpand() {
         return tabsTray.shouldExpand();
     }
+
+    @Override
+    public void closeAll() {
+        tabsTray.closeAll();
+    }
 }
--- a/mobile/android/base/tabspanel/TabsPanel.java
+++ b/mobile/android/base/tabspanel/TabsPanel.java
@@ -52,17 +52,17 @@ public class TabsPanel extends LinearLay
 
     public static interface PanelView {
         public void setTabsPanel(TabsPanel panel);
         public void show();
         public void hide();
         public boolean shouldExpand();
     }
 
-    public static interface CloseAllPanelView {
+    public static interface CloseAllPanelView extends PanelView {
         public void closeAll();
     }
 
     public static interface TabsLayoutChangeListener {
         public void onTabsLayoutChange(int width, int height);
     }
 
     private Context mContext;
--- a/mobile/android/base/tabspanel/TabsTray.java
+++ b/mobile/android/base/tabspanel/TabsTray.java
@@ -34,18 +34,17 @@ import android.view.ViewConfiguration;
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
 import android.widget.Button;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.TextView;
 
 class TabsTray extends TwoWayView
-               implements TabsPanel.PanelView,
-                          TabsPanel.CloseAllPanelView {
+               implements TabsPanel.CloseAllPanelView {
     private static final String LOGTAG = "Gecko" + TabsTray.class.getSimpleName();
 
     private Context mContext;
     private TabsPanel mTabsPanel;
 
     final private boolean mIsPrivate;
 
     private TabsAdapter mTabsAdapter;