Backed out changeset ea8134dfa481 (bug 843619) for robocop failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 25 Feb 2013 18:21:08 -0500
changeset 122967 0a5e95d8db0226559a7b9e8f50c4efa6f886e648
parent 122966 74ad7a9937dce57e196406d6e94336c427c98586
child 122968 67541ee4c5a43c64974c8bb36a7eb3e1768ba132
push id1387
push userphilringnalda@gmail.com
push dateTue, 26 Feb 2013 22:32:56 +0000
treeherderfx-team@ad4cc4e97774 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs843619
milestone22.0a1
backs outea8134dfa48112e07bc36b85ed353fbd245b8340
Backed out changeset ea8134dfa481 (bug 843619) for robocop failures.
mobile/android/base/Makefile.in
mobile/android/base/TabsPanel.java
mobile/android/base/resources/drawable-hdpi/ic_menu_new_private_tab_small.png
mobile/android/base/resources/drawable-hdpi/ic_menu_new_tab_small.png
mobile/android/base/resources/drawable-large-hdpi-v11/tabs_menu.png
mobile/android/base/resources/drawable-large-mdpi-v11/tabs_menu.png
mobile/android/base/resources/drawable-large-xhdpi-v11/tabs_menu.png
mobile/android/base/resources/drawable-mdpi/ic_menu_new_private_tab_small.png
mobile/android/base/resources/drawable-mdpi/ic_menu_new_tab_small.png
mobile/android/base/resources/drawable-xhdpi/ic_menu_new_private_tab_small.png
mobile/android/base/resources/drawable-xhdpi/ic_menu_new_tab_small.png
mobile/android/base/resources/layout-large-land-v11/tabs_panel_footer.xml
mobile/android/base/resources/layout/tabs_panel_header.xml
mobile/android/base/resources/menu-v11/tabs_menu.xml
mobile/android/base/resources/menu/tabs_menu.xml
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -551,17 +551,19 @@ RES_DRAWABLE_MDPI = \
   res/drawable-mdpi/ic_awesomebar_search.png \
   res/drawable-mdpi/ic_awesomebar_star.png \
   res/drawable-mdpi/ic_menu_addons_filler.png \
   res/drawable-mdpi/ic_menu_bookmark_add.png \
   res/drawable-mdpi/ic_menu_bookmark_remove.png \
   res/drawable-mdpi/ic_menu_close_all_tabs.png \
   res/drawable-mdpi/ic_menu_forward.png \
   res/drawable-mdpi/ic_menu_new_private_tab.png \
+  res/drawable-mdpi/ic_menu_new_private_tab_small.png \
   res/drawable-mdpi/ic_menu_new_tab.png \
+  res/drawable-mdpi/ic_menu_new_tab_small.png \
   res/drawable-mdpi/ic_menu_reload.png \
   res/drawable-mdpi/ic_status_logo.png \
   res/drawable-mdpi/progress_spinner_1.png \
   res/drawable-mdpi/progress_spinner_2.png \
   res/drawable-mdpi/progress_spinner_3.png \
   res/drawable-mdpi/progress_spinner_4.png \
   res/drawable-mdpi/progress_spinner_5.png \
   res/drawable-mdpi/progress_spinner_6.png \
@@ -662,17 +664,19 @@ RES_DRAWABLE_HDPI = \
   res/drawable-hdpi/ic_awesomebar_search.png \
   res/drawable-hdpi/ic_awesomebar_star.png \
   res/drawable-hdpi/ic_menu_addons_filler.png \
   res/drawable-hdpi/ic_menu_bookmark_add.png \
   res/drawable-hdpi/ic_menu_bookmark_remove.png \
   res/drawable-hdpi/ic_menu_close_all_tabs.png \
   res/drawable-hdpi/ic_menu_forward.png \
   res/drawable-hdpi/ic_menu_new_private_tab.png \
+  res/drawable-hdpi/ic_menu_new_private_tab_small.png \
   res/drawable-hdpi/ic_menu_new_tab.png \
+  res/drawable-hdpi/ic_menu_new_tab_small.png \
   res/drawable-hdpi/ic_menu_reload.png \
   res/drawable-hdpi/ic_status_logo.png \
   res/drawable-hdpi/tab_indicator_divider.9.png \
   res/drawable-hdpi/tab_indicator_selected.9.png \
   res/drawable-hdpi/tab_indicator_selected_focused.9.png \
   res/drawable-hdpi/spinner_default.9.png \
   res/drawable-hdpi/spinner_focused.9.png \
   res/drawable-hdpi/spinner_pressed.9.png \
@@ -753,17 +757,19 @@ RES_DRAWABLE_XHDPI = \
   res/drawable-xhdpi/ic_awesomebar_search.png \
   res/drawable-xhdpi/ic_awesomebar_star.png \
   res/drawable-xhdpi/ic_menu_addons_filler.png \
   res/drawable-xhdpi/ic_menu_bookmark_add.png \
   res/drawable-xhdpi/ic_menu_bookmark_remove.png \
   res/drawable-xhdpi/ic_menu_close_all_tabs.png \
   res/drawable-xhdpi/ic_menu_forward.png \
   res/drawable-xhdpi/ic_menu_new_private_tab.png \
+  res/drawable-xhdpi/ic_menu_new_private_tab_small.png \
   res/drawable-xhdpi/ic_menu_new_tab.png \
+  res/drawable-xhdpi/ic_menu_new_tab_small.png \
   res/drawable-xhdpi/ic_menu_reload.png \
   res/drawable-xhdpi/ic_status_logo.png \
   res/drawable-xhdpi/spinner_default.9.png \
   res/drawable-xhdpi/spinner_focused.9.png \
   res/drawable-xhdpi/spinner_pressed.9.png \
   res/drawable-xhdpi/tab_new.png \
   res/drawable-xhdpi/tab_new_pb.png \
   res/drawable-xhdpi/tab_close.png \
@@ -901,34 +907,37 @@ RES_DRAWABLE_LARGE_LAND_V11 = \
 
 RES_DRAWABLE_LARGE_MDPI_V11 = \
   res/drawable-large-mdpi-v11/ic_menu_reload.png \
   res/drawable-large-mdpi-v11/ic_menu_forward.png \
   res/drawable-large-mdpi-v11/menu.png \
   res/drawable-large-mdpi-v11/tabs_carat.png \
   res/drawable-large-mdpi-v11/tabs_carat_contracted.png \
   res/drawable-large-mdpi-v11/tabs_carat_expanded.png \
+  res/drawable-large-mdpi-v11/tabs_menu.png \
   $(NULL)
 
 RES_DRAWABLE_LARGE_HDPI_V11 = \
   res/drawable-large-hdpi-v11/ic_menu_reload.png \
   res/drawable-large-hdpi-v11/ic_menu_forward.png \
   res/drawable-large-hdpi-v11/menu.png \
   res/drawable-large-hdpi-v11/tabs_carat.png \
   res/drawable-large-hdpi-v11/tabs_carat_contracted.png \
   res/drawable-large-hdpi-v11/tabs_carat_expanded.png \
+  res/drawable-large-hdpi-v11/tabs_menu.png \
   $(NULL)
 
 RES_DRAWABLE_LARGE_XHDPI_V11 = \
   res/drawable-large-xhdpi-v11/ic_menu_reload.png \
   res/drawable-large-xhdpi-v11/ic_menu_forward.png \
   res/drawable-large-xhdpi-v11/menu.png \
   res/drawable-large-xhdpi-v11/tabs_carat.png \
   res/drawable-large-xhdpi-v11/tabs_carat_contracted.png \
   res/drawable-large-xhdpi-v11/tabs_carat_expanded.png \
+  res/drawable-large-xhdpi-v11/tabs_menu.png \
   $(NULL)
 
 RES_DRAWABLE_XLARGE_MDPI_V11 = \
   res/drawable-xlarge-mdpi-v11/awesomebar_tab_center.9.png \
   res/drawable-xlarge-mdpi-v11/awesomebar_tab_left.9.png \
   res/drawable-xlarge-mdpi-v11/awesomebar_tab_right.9.png \
   res/drawable-xlarge-mdpi-v11/ic_menu_bookmark_add.png \
   res/drawable-xlarge-mdpi-v11/ic_menu_bookmark_remove.png \
@@ -953,18 +962,20 @@ RES_DRAWABLE_XLARGE_XHDPI_V11 = \
 RES_COLOR = \
   res/color/menu_item_title.xml \
   res/color/select_item_multichoice.xml \
   $(NULL)
 
 RES_MENU = \
   res/menu/awesomebar_contextmenu.xml \
   res/menu/gecko_app_menu.xml \
+  res/menu/tabs_menu.xml \
   res/menu/titlebar_contextmenu.xml \
   res/menu/abouthome_topsites_contextmenu.xml \
+  res/menu-v11/tabs_menu.xml \
   $(NULL)
 
 JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
 
 ifdef MOZ_CRASHREPORTER
 FENNEC_PP_JAVA_FILES += CrashReporter.java
 RES_DRAWABLE_MDPI += res/drawable-mdpi/crash_reporter.png
 RES_LAYOUT += res/layout/crash_reporter.xml
--- a/mobile/android/base/TabsPanel.java
+++ b/mobile/android/base/TabsPanel.java
@@ -22,17 +22,18 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.FrameLayout;
 import android.widget.ImageButton;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 
 public class TabsPanel extends LinearLayout
-                       implements LightweightTheme.OnChangeListener,
+                       implements GeckoPopupMenu.OnMenuItemClickListener,
+                                  LightweightTheme.OnChangeListener,
                                   IconTabWidget.OnTabChangedListener {
     private static final String LOGTAG = "GeckoTabsPanel";
 
     public static enum Panel {
         NORMAL_TABS,
         PRIVATE_TABS,
         REMOTE_TABS
     }
@@ -55,36 +56,45 @@ public class TabsPanel extends LinearLay
     private PanelView mPanel;
     private PanelView mPanelNormal;
     private PanelView mPanelPrivate;
     private PanelView mPanelRemote;
     private RelativeLayout mFooter;
     private TabsLayoutChangeListener mLayoutChangeListener;
 
     private IconTabWidget mTabWidget;
+    private static ImageButton mMenuButton;
     private static ImageButton mAddTab;
 
     private Panel mCurrentPanel;
     private boolean mIsSideBar;
     private boolean mVisible;
 
+    private GeckoPopupMenu mPopupMenu;
+    private Menu mMenu;
+
     public TabsPanel(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
         mActivity = (GeckoApp) context;
 
         setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
                                                       LinearLayout.LayoutParams.FILL_PARENT));
         setOrientation(LinearLayout.VERTICAL);
 
         mCurrentPanel = Panel.NORMAL_TABS;
         mVisible = false;
 
         mIsSideBar = false;
 
+        mPopupMenu = new GeckoPopupMenu(context);
+        mPopupMenu.inflate(R.menu.tabs_menu);
+        mPopupMenu.setOnMenuItemClickListener(this);
+        mMenu = mPopupMenu.getMenu();
+
         LayoutInflater.from(context).inflate(R.layout.tabs_panel, this);
         initialize();
     }
 
     private void initialize() {
         mTabsContainer = (TabsListContainer) findViewById(R.id.tabs_container);
 
         mPanelNormal = (TabsTray) findViewById(R.id.normal_tabs);
@@ -105,37 +115,74 @@ public class TabsPanel extends LinearLay
             }
         });
 
         mTabWidget = (IconTabWidget) findViewById(R.id.tab_widget);
         mTabWidget.addTab(R.drawable.tabs_normal);
         mTabWidget.addTab(R.drawable.tabs_private);
         mTabWidget.addTab(R.drawable.tabs_synced);
         mTabWidget.setTabSelectionListener(this);
+
+        mMenuButton = (ImageButton) findViewById(R.id.menu);
+        mMenuButton.setOnClickListener(new Button.OnClickListener() {
+            public void onClick(View view) {
+                TabsPanel.this.openTabsMenu();
+            }
+        });
+
+        mPopupMenu.setAnchor(mMenuButton);
     }
 
     public void addTab() {
         if (mCurrentPanel == Panel.NORMAL_TABS)
            mActivity.addTab();
         else
            mActivity.addPrivateTab();
 
         mActivity.autoHideTabs();
     }
 
+    public void openTabsMenu() {
+        if (mCurrentPanel == Panel.REMOTE_TABS)
+            mMenu.findItem(R.id.close_all_tabs).setEnabled(false);
+        else
+            mMenu.findItem(R.id.close_all_tabs).setEnabled(true); 
+
+        mPopupMenu.show();
+    }
+
     @Override
     public void onTabChanged(int index) {
         if (index == 0)
             show(Panel.NORMAL_TABS, false);
         else if (index == 1)
             show(Panel.PRIVATE_TABS, false);
         else
             show(Panel.REMOTE_TABS, false);
     }
 
+    @Override
+    public boolean onMenuItemClick(MenuItem item) {
+        switch (item.getItemId()) {
+            case R.id.close_all_tabs:
+                for (Tab tab : Tabs.getInstance().getTabsInOrder()) {
+                    Tabs.getInstance().closeTab(tab);
+                }
+                autoHidePanel();
+                return true;
+
+            case R.id.new_tab:
+            case R.id.new_private_tab:
+                hide();
+            // fall through
+            default:
+                return mActivity.onOptionsItemSelected(item);
+        }
+    }
+
     private static int getTabContainerHeight(TabsListContainer listContainer) {
         Context context = listContainer.getContext();
 
         PanelView panelView = listContainer.getCurrentPanelView();
         if (panelView != null && !panelView.shouldExpand()) {
             final View v = (View) panelView;
             final int sizeSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
             v.measure(sizeSpec, sizeSpec);
@@ -305,22 +352,24 @@ public class TabsPanel extends LinearLay
 
         mPanel.show();
 
         if (mCurrentPanel == Panel.REMOTE_TABS) {
             if (mFooter != null)
                 mFooter.setVisibility(View.GONE);
 
             mAddTab.setVisibility(View.INVISIBLE);
+            mMenuButton.setVisibility(View.INVISIBLE);
         } else {
             if (mFooter != null)
                 mFooter.setVisibility(View.VISIBLE);
 
             mAddTab.setVisibility(View.VISIBLE);
             mAddTab.setImageLevel(index);
+            mMenuButton.setVisibility(View.VISIBLE);
         }
 
         if (shouldResize) {
             if (isSideBar()) {
                 if (showAnimation)
                     dispatchLayoutChange(getWidth(), getHeight());
             } else {
                 int actionBarHeight = mContext.getResources().getDimensionPixelSize(R.dimen.browser_toolbar_height);
@@ -328,16 +377,17 @@ public class TabsPanel extends LinearLay
                 dispatchLayoutChange(getWidth(), height);
             }
         }
     }
 
     public void hide() {
         if (mVisible) {
             mVisible = false;
+            mPopupMenu.dismiss();
             dispatchLayoutChange(0, 0);
 
             if (mPanel != null) {
                 mPanel.hide();
                 mPanel = null;
             }
         }
     }
new file mode 100644
index 0000000000000000000000000000000000000000..d9bb94084f782a0e40df286325a99365138162ea
GIT binary patch
literal 424
zc%17D@N?(olHy`uVBq!ia0vp^_8`o`1|-Ad1@1F2Fy?!@IEGZ*dV71L*Wmz(qaRy#
zyj+qU{!x@AeEK(4nUaFnVO&-}S$36Aa1s|kXntYs<mL;pnmcFnbu9|A?=NWcev#n8
zV*gI^-;$qs?>;n7+p_fR8J(Lg;&BxZTgB~C|J?icF#d|Gs!>?cw5>Pnj|#`F^kL0E
zEd-RVzx8mV!|sfhcNfL`r@vs-t+0Dk%KANb_fcU}Xa5sfUry9=pZ{T=!dvyRhyUU&
z?Oo32Pk$@2bC$oj=1b51hcyk?ETf&nKibV(UsTJ?Yq9@ZkNu-RBBB>-R&UBTj*50n
zpEJMWSoxyswGPQ8J-?>b)}A}Q=iH9<kHyZn#jL(Pf$jPaCf}?>=L6r#oi8eBShnZ+
z{?8v-ce&1=<6jxOZu|B_-1>Vy9QrRLUw`w(8lh6@hqi}q{|QN-Cv10dd2L45`-Kk#
z?A&edzJmG`jo7zUUamdl!&QCP=W|kZm)T2mfJ_4#nR;J8b=$kuMjx&KV}QZa)z4*}
HQ$iB}xbDmA
new file mode 100644
index 0000000000000000000000000000000000000000..03d042fa93aa96a40b54143ee512d5f141b21f99
GIT binary patch
literal 225
zc%17D@N?(olHy`uVBq!ia0vp^_8`o`1|-Ad1?~f>6`n4RAr-gY-Ztc7Rupi!xOZN4
zr$}behXu!H_y`Id3cKiVB>YcRg#t&joZ!aX4`5*ZIRE=`eXYo|k7CcBdLmih{r*GT
zT~_(<gNM;Ueee6z$BwRwlsr`aW75^Ynl&<imL1>M`{?`{U5@&+<*WJR&_Ug;!;iOd
q|2uQ*`KH28Jo9-UJOqKq6^#41yq4q(>%9fKnZeW5&t;ucLK6U3=4JN)
new file mode 100644
index 0000000000000000000000000000000000000000..fd36e743446db030757f523827c02126a454f312
GIT binary patch
literal 118
zc%17D@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBY&~5ZLn>~)y}FQ-!GVYQ!2SAW
zzu9>KffXw(1nZSl^iQs2_{(xtL;(oAd6!&qaBx`1?6I=3p&^F-f*SA6b5n|zyQZfB
P4Px+g^>bP0l+XkKIU^&~
new file mode 100644
index 0000000000000000000000000000000000000000..1c1b42cd78a1e0c3341ffcd21b7ece54236f20b0
GIT binary patch
literal 103
zc%17D@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjdY&$hAr-gYURub@z`$|9;NSm-
z?Dpf%3NvS{i)2_lmvNK&2lj$sM)Oi2j%DO}f8<%-zAiIapiTx)S3j3^P6<r_j;|kx
new file mode 100644
index 0000000000000000000000000000000000000000..c45f8c671cbbc41f8510e44ea40c57bc021fb8fe
GIT binary patch
literal 133
zc%17D@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCA5Ry@kcwMxuWjUIaNuCxc)y-`
z8Lzg&E_XenhS@LTCaq^L;0>6}$N&Z&oIt{y3(Qtf1rmD%!0d)OKof7QWnA!X=A#sg
QMIj(DPgg&ebxsLQ0Mg7L1ONa4
new file mode 100644
index 0000000000000000000000000000000000000000..8242f7fb4a14af965b321b677021adcf129bddd7
GIT binary patch
literal 308
zc$@(=0n7f0P)<h;3K|Lk000e1NJLTq001fg001fo1^@s6#ly*40002{Nkl<Zc-rmR
zu}Z^G6o>IXgk9=bUqT;3mu?jV<6wQ7<Xt+7lEK|V5jVj>LE5ED+e`5D8_tkHf&uZQ
z<v;wmaB~UYaxdYgXJ&grq2Zxd*=>^?mCJv4-kHz@bE(UrR=2OABOK!rQ!KE;laC9Z
zA7g+~RH(HT6}oI0x{L~)VUBYg;RY4V$7}R);p?8GLJNH0wDzt?7#?bKXZS=B6?%dV
z%!5mO!F()z-hACKB-Gu(eqj=Rjv~V=)_B7`-m$?8G9CB|Rp@_(`Zwej7Ho^WDfAoG
z5!FG27D%vQ359mOLKUh|g(_5`3RS2sa{u^hTt6EW+SU#(BCPi-*`KKZ0000<MNUMn
GLSTY5H-^0c
new file mode 100644
index 0000000000000000000000000000000000000000..2d1453d1ccb8afffdc5446dd3de1a677c2f10dbd
GIT binary patch
literal 175
zc%17D@N?(olHy`uVBq!ia0vp^S|H591|*LjJ{b+9$~;{hLn>~)y=lmGK!L~Y;k_-+
z)8*XzvnTvJ`{06Oi_^i7dmonR+*k70<oV0hVY&17$1+p*-13@RDY2q5D>7xpJVsV7
z5siQa4vp)0bL&q$$}BqSt^DGtrbj7f#y1^?OMA|&W``<ZN}c%oW7eEx<_p{Jn&10&
Vk#&~P9H0vrJYD@<);T3K0RZP?MZ^FA
new file mode 100644
index 0000000000000000000000000000000000000000..698f8e17618e771b0a54129be2b7056bfad5dc95
GIT binary patch
literal 637
zc%17D@N?(olHy`uVBq!ia0vp^At21b1|(&&1r9PWFu8cTIEGZ*dVAN<TRKtZ_(!jH
zzC}$F4tjdK#yeS+zF61Ml)XUf#>xlJ7A$pQ<<?W}5^-JAx=3jslY4x_g&iU+f!<4&
zx;YAo%h%8NKS8dX-EtlK+t0H5PT&3C_d!vyod4mc6PE6p&ukeMG%$HJ{A*s&y7A<i
z?C|)jTZ^u3&CNdlW9uLB1*=cFZsE%K9Gc{y-C#Dqn>)aPk#$R)UP^R#)xxkV6IZR0
z{_3l{f`3)Y?NzT%q{Xi~u9Y$IGuxE}wvg$kR)2rxva@CG>dL9xi}_YL&v%Fw`^ge@
zmSM{y;TP|D9O{3uRLx<0Q9j>+pQ%{YbltAd^;K)nJ>J)n^K7Q9@j|c0nYHsB>`l+`
zxSz2J4Oe`=C&X6pIFH#G(OM?itQnErGov{zpBJ6^Q+4>x3jYQEOz-!_P7T*>+_`Z=
z@jkAdiWTd&F?)Bcz1I*`toV6(mcQ<*%&n3}n-hPF<$g0sNjrGF`e#__vY1n`EBxL&
ztQ9PsuJmlK)VJELFJrqFY}UDdb#~BpPsO)4%-6L4i`=iZ$~iR5^s94ipz*7<w*vR)
z#NSM_UuAdyx^rX#n+PaSV8nl+6@S?_uh2R*aaFX=%55qOqFEUh|C+<HC5%CDRn+GN
z3y!j7occJ?f4fw?*UN1)zii6%j1^_5IiWKxR9gJo9Zg0q4Pbl_NqjnyAeY6Pak+HG
w+5?Yu^KzrF^~XN%XZ*38)qxY}p0E3=6;6sPN5A&E1WZ;8p00i_>zopr0M+IefB*mh
new file mode 100644
index 0000000000000000000000000000000000000000..764c9de091e515763c323374e482c8c7b337e05a
GIT binary patch
literal 327
zc%17D@N?(olHy`uVBq!ia0vp^At21b1|(&&1r9PWF!Fi2IEGZ*dV6;xSCfOpfsb(u
zs*XrURV~QLTBTTHUA*b#FAiDJDTi0o9hN`hS*I|spl16?%hd_>{0t%*0gQj0E|gfT
zyQ{a$J$K6QTmSCmJx%|~dBJ;%`!0sL@y3j|faE+bjerFXjZCauB7_)X3~#?D%xjA+
zsJiYFx+Rt=O1&XDc6vh@=bebVH31ou8FlA`@5`CnA9OR%d%ADv7Y~MZxr>&!qHg>S
zW+H4lgrVHbyOqsqcWsFKdB#oq*V!AC-95<Q7sa3jRPnD?-}tGs*@ad~1`zOc^>bP0
Hl+XkK37&KW
--- a/mobile/android/base/resources/layout-large-land-v11/tabs_panel_footer.xml
+++ b/mobile/android/base/resources/layout-large-land-v11/tabs_panel_footer.xml
@@ -1,17 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <ImageButton android:id="@+id/add_tab"
-                 android:layout_width="fill_parent"
+                 android:layout_width="@dimen/browser_toolbar_height"
                  android:layout_height="@dimen/browser_toolbar_height"
                  android:padding="14dip"
                  android:src="@drawable/tab_new_level"
                  android:contentDescription="@string/new_tab"
-                 android:background="@drawable/action_bar_button"
-                 android:gravity="center"/>
+                 android:background="@drawable/action_bar_button"/>
+
+    <View android:layout_width="0dip"
+          android:layout_height="@dimen/browser_toolbar_height"
+          android:layout_weight="1.0"/>
+
+    <ImageButton android:id="@+id/menu"
+                 android:layout_width="@dimen/browser_toolbar_height"
+                 android:layout_height="@dimen/browser_toolbar_height"
+                 android:padding="14dip"
+                 android:src="@drawable/tabs_menu"
+                 android:contentDescription="@string/menu"
+                 android:background="@drawable/action_bar_button"/>
 
 </merge>
--- a/mobile/android/base/resources/layout/tabs_panel_header.xml
+++ b/mobile/android/base/resources/layout/tabs_panel_header.xml
@@ -19,9 +19,18 @@
                  style="@style/AddressBar.ImageButton"
                  android:layout_width="@dimen/browser_toolbar_height"
                  android:layout_height="@dimen/browser_toolbar_height"
                  android:padding="@dimen/browser_toolbar_button_padding"
                  android:src="@drawable/tab_new_level"
                  android:contentDescription="@string/new_tab"
                  android:background="@drawable/action_bar_button"/>
 
+    <ImageButton android:id="@+id/menu"
+                 style="@style/AddressBar.ImageButton"
+                 android:layout_width="@dimen/browser_toolbar_height"
+                 android:layout_height="@dimen/browser_toolbar_height"
+                 android:padding="@dimen/browser_toolbar_button_padding"
+                 android:src="@drawable/menu"
+                 android:contentDescription="@string/menu"
+                 android:background="@drawable/action_bar_button"/>
+
 </merge>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/menu-v11/tabs_menu.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:id="@+id/new_tab"
+          android:icon="@drawable/ic_menu_new_tab"
+          android:title="@string/new_tab"/>
+
+    <item android:id="@+id/new_private_tab"
+          android:icon="@drawable/ic_menu_new_private_tab"
+          android:title="@string/new_private_tab"/>
+
+    <item android:id="@+id/close_all_tabs"
+          android:icon="@drawable/ic_menu_close_all_tabs"
+          android:title="@string/close_all_tabs"/>
+
+</menu>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/menu/tabs_menu.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:id="@+id/new_tab"
+          android:icon="@drawable/ic_menu_new_tab_small"
+          android:title="@string/new_tab"/>
+
+    <item android:id="@+id/new_private_tab"
+          android:icon="@drawable/ic_menu_new_private_tab_small"
+          android:title="@string/new_private_tab"/>
+
+    <item android:id="@+id/close_all_tabs"
+          android:icon="@drawable/ic_menu_close_all_tabs"
+          android:title="@string/close_all_tabs"/>
+
+</menu>