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 190124 78ffdbef077c1a1c62d2a9570838dccb0c908696
parent 190123 b4cbfab9148b7692d4c7c0eba8d0836666743120
child 190125 55b0aa2da501b7999b09e168f203cad29f7233ca
push id7406
push usermichael.l.comella@gmail.com
push dateMon, 23 Jun 2014 18:00:58 +0000
treeherderfx-team@78ffdbef077c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1028337
milestone33.0a1
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;