Bug 1140210 - Backout 4 changesets to backout top level share plane (bug 1140048).
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 18 Nov 2015 16:12:29 -0800
changeset 273308 e804e442d303eae31503afd950da6b0da06fad1e
parent 273307 e3462f6085ecead4d6664189bbcbb20a7055665e
child 273309 1e789580b2065698615e61665dcfca42028f8d17
push id16316
push usermichael.l.comella@gmail.com
push dateThu, 19 Nov 2015 16:48:41 +0000
treeherderfx-team@1e789580b206 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1140210, 1140048
milestone45.0a1
Bug 1140210 - Backout 4 changesets to backout top level share plane (bug 1140048). This is not strictly necessary but it prevents a clean backout. Changesets: * 5b439b4654e0 * 8345f21f6518 * 156585c07b3d * 623b15184f2a
mobile/android/base/menu/GeckoMenu.java
mobile/android/base/menu/MenuItemActionView.java
mobile/android/base/menu/MenuItemSwitcherLayout.java
mobile/android/base/moz.build
mobile/android/base/prompts/PromptListAdapter.java
mobile/android/base/resources/layout/menu_item_action_view.xml
mobile/android/base/resources/layout/menu_item_switcher_layout.xml
mobile/android/base/resources/values-v11/themes.xml
mobile/android/base/resources/values-v14/themes.xml
mobile/android/base/resources/values-v21/themes.xml
mobile/android/base/resources/values/attrs.xml
mobile/android/base/resources/values/styles.xml
mobile/android/base/widget/GeckoActionProvider.java
--- a/mobile/android/base/menu/GeckoMenu.java
+++ b/mobile/android/base/menu/GeckoMenu.java
@@ -254,24 +254,24 @@ public class GeckoMenu extends ListView
                 public boolean onLongClick(View view) {
                     if (handleMenuItemLongClick(menuItem)) {
                         GeckoAppShell.vibrateOnHapticFeedbackEnabled(getResources().getIntArray(R.array.long_press_vibrate_msec));
                         return true;
                     }
                     return false;
                 }
             });
-        } else if (actionView instanceof MenuItemSwitcherLayout) {
-            ((MenuItemSwitcherLayout) actionView).setMenuItemClickListener(new View.OnClickListener() {
+        } else if (actionView instanceof MenuItemActionView) {
+            ((MenuItemActionView) actionView).setMenuItemClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View view) {
                     handleMenuItemClick(menuItem);
                 }
             });
-            ((MenuItemSwitcherLayout) actionView).setMenuItemLongClickListener(new View.OnLongClickListener() {
+            ((MenuItemActionView) actionView).setMenuItemLongClickListener(new View.OnLongClickListener() {
                 @Override
                 public boolean onLongClick(View view) {
                     if (handleMenuItemLongClick(menuItem)) {
                         GeckoAppShell.vibrateOnHapticFeedbackEnabled(getResources().getIntArray(R.array.long_press_vibrate_msec));
                         return true;
                     }
                     return false;
                 }
@@ -596,17 +596,17 @@ public class GeckoMenu extends ListView
             }
 
             if (actionView != null) {
                 if (item.isVisible()) {
                     actionView.setVisibility(View.VISIBLE);
                     if (actionView instanceof MenuItemActionBar) {
                         ((MenuItemActionBar) actionView).initialize(item);
                     } else {
-                        ((MenuItemSwitcherLayout) actionView).initialize(item);
+                        ((MenuItemActionView) actionView).initialize(item);
                     }
                 } else {
                     actionView.setVisibility(View.GONE);
                 }
             }
         } else {
             mAdapter.notifyDataSetChanged();
         }
@@ -727,18 +727,18 @@ public class GeckoMenu extends ListView
 
             if (actualParams != null) {
                 params = new LinearLayout.LayoutParams(actionItem.getLayoutParams());
                 params.width = 0;
             } else {
                 params = new LinearLayout.LayoutParams(0, mRowHeight);
             }
 
-            if (actionItem instanceof MenuItemSwitcherLayout) {
-                params.weight = ((MenuItemSwitcherLayout) actionItem).getChildCount();
+            if (actionItem instanceof MenuItemActionView) {
+                params.weight = ((MenuItemActionView) actionItem).getChildCount();
             } else {
                 params.weight = 1.0f;
             }
 
             mWeightSum += params.weight;
 
             actionItem.setLayoutParams(params);
             addView(actionItem);
@@ -807,27 +807,27 @@ public class GeckoMenu extends ListView
 
             // Try to re-use the view.
             if (convertView == null && getItemViewType(position) == VIEW_TYPE_DEFAULT) {
                 view = new MenuItemDefault(parent.getContext(), null);
             } else {
                 view = (GeckoMenuItem.Layout) convertView;
             }
 
-            if (view == null || view instanceof MenuItemSwitcherLayout) {
+            if (view == null || view instanceof MenuItemActionView) {
                 // Always get from the menu item.
                 // This will ensure that the default activity is refreshed.
-                view = (MenuItemSwitcherLayout) item.getActionView();
+                view = (MenuItemActionView) item.getActionView();
 
                 // ListView will not perform an item click if the row has a focusable view in it.
                 // Hence, forward the click event on the menu item in the action-view to the ListView.
                 final View actionView = (View) view;
                 final int pos = position;
                 final long id = getItemId(position);
-                ((MenuItemSwitcherLayout) view).setMenuItemClickListener(new View.OnClickListener() {
+                ((MenuItemActionView) view).setMenuItemClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
                         GeckoMenu listView = GeckoMenu.this;
                         listView.performItemClick(actionView, pos + listView.getHeaderViewsCount(), id);
                     }
                 });
             }
 
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/menu/MenuItemActionView.java
@@ -0,0 +1,182 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+/* 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/. */
+
+package org.mozilla.gecko.menu;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.mozilla.gecko.AppConstants.Versions;
+import org.mozilla.gecko.R;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+
+public class MenuItemActionView extends LinearLayout
+                                implements GeckoMenuItem.Layout,
+                                           View.OnClickListener {
+    private final MenuItemDefault mMenuItem;
+    private final MenuItemActionBar mMenuButton;
+    private final List<ImageButton> mActionButtons;
+    private final List<View.OnClickListener> mActionButtonListeners = new ArrayList<View.OnClickListener>();
+
+    public MenuItemActionView(Context context) {
+        this(context, null);
+    }
+
+    public MenuItemActionView(Context context, AttributeSet attrs) {
+        this(context, attrs, R.attr.menuItemActionViewStyle);
+    }
+
+    @TargetApi(14)
+    public MenuItemActionView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs);
+
+        LayoutInflater.from(context).inflate(R.layout.menu_item_action_view, this);
+        mMenuItem = (MenuItemDefault) findViewById(R.id.menu_item);
+        mMenuButton = (MenuItemActionBar) findViewById(R.id.menu_item_button);
+        mActionButtons = new ArrayList<ImageButton>();
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+        final int width = right - left;
+
+        final View parent = (View) getParent();
+        final int parentPadding = parent.getPaddingLeft() + parent.getPaddingRight();
+        final int horizontalSpaceAvailableInParent = parent.getMeasuredWidth() - parentPadding;
+
+        // Check if there is another View sharing horizontal
+        // space with this View in the parent.
+        if (width < horizontalSpaceAvailableInParent || mActionButtons.size() != 0) {
+            // Use the icon.
+            mMenuItem.setVisibility(View.GONE);
+            mMenuButton.setVisibility(View.VISIBLE);
+        } else {
+            // Use the button.
+            mMenuItem.setVisibility(View.VISIBLE);
+            mMenuButton.setVisibility(View.GONE);
+        }
+
+        super.onLayout(changed, left, top, right, bottom);
+    }
+
+    @Override
+    public void initialize(GeckoMenuItem item) {
+        if (item == null) {
+            return;
+        }
+
+        mMenuItem.initialize(item);
+        mMenuButton.initialize(item);
+        setEnabled(item.isEnabled());
+    }
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        super.setEnabled(enabled);
+        mMenuItem.setEnabled(enabled);
+        mMenuButton.setEnabled(enabled);
+
+        for (ImageButton button : mActionButtons) {
+             button.setEnabled(enabled);
+             button.setAlpha(enabled ? 255 : 99);
+        }
+    }
+
+    public void setMenuItemClickListener(View.OnClickListener listener) {
+        mMenuItem.setOnClickListener(listener);
+        mMenuButton.setOnClickListener(listener);
+    }
+
+    public void setMenuItemLongClickListener(View.OnLongClickListener listener) {
+        mMenuItem.setOnLongClickListener(listener);
+        mMenuButton.setOnLongClickListener(listener);
+    }
+
+    public void addActionButtonClickListener(View.OnClickListener listener) {
+        mActionButtonListeners.add(listener);
+    }
+
+    @Override
+    public void setShowIcon(boolean show) {
+        mMenuItem.setShowIcon(show);
+    }
+
+    public void setIcon(Drawable icon) {
+        mMenuItem.setIcon(icon);
+        mMenuButton.setIcon(icon);
+    }
+
+    public void setIcon(int icon) {
+        mMenuItem.setIcon(icon);
+        mMenuButton.setIcon(icon);
+    }
+
+    public void setTitle(CharSequence title) {
+        mMenuItem.setTitle(title);
+        mMenuButton.setContentDescription(title);
+    }
+
+    public void setSubMenuIndicator(boolean hasSubMenu) {
+        mMenuItem.setSubMenuIndicator(hasSubMenu);
+    }
+
+    public void addActionButton(Drawable drawable, CharSequence label) {
+        // If this is the first icon, retain the text.
+        // If not, make the menu item an icon.
+        final int count = mActionButtons.size();
+        mMenuItem.setVisibility(View.GONE);
+        mMenuButton.setVisibility(View.VISIBLE);
+
+        if (drawable != null) {
+            ImageButton button = new ImageButton(getContext(), null, R.attr.menuItemShareActionButtonStyle);
+            button.setImageDrawable(drawable);
+            button.setContentDescription(label);
+            button.setOnClickListener(this);
+            button.setTag(count);
+
+            final int height = (int) (getResources().getDimension(R.dimen.menu_item_row_height));
+            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, height);
+            params.weight = 1.0f;
+            button.setLayoutParams(params);
+
+            // Fill in the action-buttons to the left of the actual menu button.
+            mActionButtons.add(button);
+            addView(button, count);
+        }
+    }
+
+    protected int getActionButtonCount() {
+        return mActionButtons.size();
+    }
+
+    @Override
+    public void onClick(View view) {
+        for (View.OnClickListener listener : mActionButtonListeners) {
+            listener.onClick(view);
+        }
+    }
+
+    /**
+     * Update the styles if this view is being used in the context menus.
+     *
+     * Ideally, we just use different layout files and styles to set this, but
+     * MenuItemActionView is too integrated into GeckoActionProvider to provide
+     * an easy separation so instead I provide this hack. I'm sorry.
+     */
+    public void initContextMenuStyles() {
+        final int defaultContextMenuPadding = getContext().getResources().getDimensionPixelOffset(
+                R.dimen.context_menu_item_horizontal_padding);
+        mMenuItem.setPadding(defaultContextMenuPadding, getPaddingTop(),
+                defaultContextMenuPadding, getPaddingBottom());
+    }
+}
deleted file mode 100644
--- a/mobile/android/base/menu/MenuItemSwitcherLayout.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
-/* 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/. */
-
-package org.mozilla.gecko.menu;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.mozilla.gecko.AppConstants.Versions;
-import org.mozilla.gecko.R;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-
-/**
- * This class is a container view for menu items that:
- *   * Shows text if there is enough space and there are
- *     no action buttons ({@link #mActionButtons}).
- *   * Shows an icon if there is not enough space for text,
- *     or there are action buttons.
- */
-public class MenuItemSwitcherLayout extends LinearLayout
-                                    implements GeckoMenuItem.Layout,
-                                               View.OnClickListener {
-    private final MenuItemDefault mMenuItem;
-    private final MenuItemActionBar mMenuButton;
-    private final List<ImageButton> mActionButtons;
-    private final List<View.OnClickListener> mActionButtonListeners = new ArrayList<View.OnClickListener>();
-
-    public MenuItemSwitcherLayout(Context context) {
-        this(context, null);
-    }
-
-    public MenuItemSwitcherLayout(Context context, AttributeSet attrs) {
-        this(context, attrs, R.attr.menuItemSwitcherLayoutStyle);
-    }
-
-    @TargetApi(14)
-    public MenuItemSwitcherLayout(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs);
-
-        LayoutInflater.from(context).inflate(R.layout.menu_item_switcher_layout, this);
-        mMenuItem = (MenuItemDefault) findViewById(R.id.menu_item);
-        mMenuButton = (MenuItemActionBar) findViewById(R.id.menu_item_button);
-        mActionButtons = new ArrayList<ImageButton>();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        final int width = right - left;
-
-        final View parent = (View) getParent();
-        final int parentPadding = parent.getPaddingLeft() + parent.getPaddingRight();
-        final int horizontalSpaceAvailableInParent = parent.getMeasuredWidth() - parentPadding;
-
-        // Check if there is another View sharing horizontal
-        // space with this View in the parent.
-        if (width < horizontalSpaceAvailableInParent || mActionButtons.size() != 0) {
-            // Use the icon.
-            mMenuItem.setVisibility(View.GONE);
-            mMenuButton.setVisibility(View.VISIBLE);
-        } else {
-            // Use the button.
-            mMenuItem.setVisibility(View.VISIBLE);
-            mMenuButton.setVisibility(View.GONE);
-        }
-
-        super.onLayout(changed, left, top, right, bottom);
-    }
-
-    @Override
-    public void initialize(GeckoMenuItem item) {
-        if (item == null) {
-            return;
-        }
-
-        mMenuItem.initialize(item);
-        mMenuButton.initialize(item);
-        setEnabled(item.isEnabled());
-    }
-
-    @Override
-    public void setEnabled(boolean enabled) {
-        super.setEnabled(enabled);
-        mMenuItem.setEnabled(enabled);
-        mMenuButton.setEnabled(enabled);
-
-        for (ImageButton button : mActionButtons) {
-             button.setEnabled(enabled);
-             button.setAlpha(enabled ? 255 : 99);
-        }
-    }
-
-    public void setMenuItemClickListener(View.OnClickListener listener) {
-        mMenuItem.setOnClickListener(listener);
-        mMenuButton.setOnClickListener(listener);
-    }
-
-    public void setMenuItemLongClickListener(View.OnLongClickListener listener) {
-        mMenuItem.setOnLongClickListener(listener);
-        mMenuButton.setOnLongClickListener(listener);
-    }
-
-    public void addActionButtonClickListener(View.OnClickListener listener) {
-        mActionButtonListeners.add(listener);
-    }
-
-    @Override
-    public void setShowIcon(boolean show) {
-        mMenuItem.setShowIcon(show);
-    }
-
-    public void setIcon(Drawable icon) {
-        mMenuItem.setIcon(icon);
-        mMenuButton.setIcon(icon);
-    }
-
-    public void setIcon(int icon) {
-        mMenuItem.setIcon(icon);
-        mMenuButton.setIcon(icon);
-    }
-
-    public void setTitle(CharSequence title) {
-        mMenuItem.setTitle(title);
-        mMenuButton.setContentDescription(title);
-    }
-
-    public void setSubMenuIndicator(boolean hasSubMenu) {
-        mMenuItem.setSubMenuIndicator(hasSubMenu);
-    }
-
-    public void addActionButton(Drawable drawable, CharSequence label) {
-        // If this is the first icon, retain the text.
-        // If not, make the menu item an icon.
-        final int count = mActionButtons.size();
-        mMenuItem.setVisibility(View.GONE);
-        mMenuButton.setVisibility(View.VISIBLE);
-
-        if (drawable != null) {
-            ImageButton button = new ImageButton(getContext(), null, R.attr.menuItemShareActionButtonStyle);
-            button.setImageDrawable(drawable);
-            button.setContentDescription(label);
-            button.setOnClickListener(this);
-            button.setTag(count);
-
-            final int height = (int) (getResources().getDimension(R.dimen.menu_item_row_height));
-            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, height);
-            params.weight = 1.0f;
-            button.setLayoutParams(params);
-
-            // Fill in the action-buttons to the left of the actual menu button.
-            mActionButtons.add(button);
-            addView(button, count);
-        }
-    }
-
-    protected int getActionButtonCount() {
-        return mActionButtons.size();
-    }
-
-    @Override
-    public void onClick(View view) {
-        for (View.OnClickListener listener : mActionButtonListeners) {
-            listener.onClick(view);
-        }
-    }
-
-    /**
-     * Update the styles if this view is being used in the context menus.
-     *
-     * Ideally, we just use different layout files and styles to set this, but
-     * MenuItemSwitcherLayout is too integrated into GeckoActionProvider to provide
-     * an easy separation so instead I provide this hack. I'm sorry.
-     */
-    public void initContextMenuStyles() {
-        final int defaultContextMenuPadding = getContext().getResources().getDimensionPixelOffset(
-                R.dimen.context_menu_item_horizontal_padding);
-        mMenuItem.setPadding(defaultContextMenuPadding, getPaddingTop(),
-                defaultContextMenuPadding, getPaddingBottom());
-    }
-}
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -419,18 +419,18 @@ gbjar.sources += [
     'mdns/MulticastDNSManager.java',
     'MediaCastingBar.java',
     'MemoryMonitor.java',
     'menu/GeckoMenu.java',
     'menu/GeckoMenuInflater.java',
     'menu/GeckoMenuItem.java',
     'menu/GeckoSubMenu.java',
     'menu/MenuItemActionBar.java',
+    'menu/MenuItemActionView.java',
     'menu/MenuItemDefault.java',
-    'menu/MenuItemSwitcherLayout.java',
     'menu/MenuPanel.java',
     'menu/MenuPopup.java',
     'MotionEventInterceptor.java',
     'NotificationClient.java',
     'NotificationHandler.java',
     'NotificationHelper.java',
     'NotificationService.java',
     'NSSBridge.java',
--- a/mobile/android/base/prompts/PromptListAdapter.java
+++ b/mobile/android/base/prompts/PromptListAdapter.java
@@ -1,29 +1,36 @@
 package org.mozilla.gecko.prompts;
 
+import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
-import org.mozilla.gecko.menu.MenuItemSwitcherLayout;
+import org.mozilla.gecko.gfx.BitmapUtils;
+import org.mozilla.gecko.menu.MenuItemActionView;
 import org.mozilla.gecko.widget.GeckoActionProvider;
 
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.json.JSONException;
+
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Resources;
 import android.graphics.drawable.Drawable;
 import android.graphics.Bitmap;
 import android.graphics.drawable.BitmapDrawable;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.CheckedTextView;
 import android.widget.TextView;
 import android.widget.ListView;
 import android.widget.ArrayAdapter;
+import android.widget.AdapterView;
 import android.util.TypedValue;
 
 import java.util.ArrayList;
 
 public class PromptListAdapter extends ArrayAdapter<PromptListItem> {
     private static final int VIEW_TYPE_ITEM = 0;
     private static final int VIEW_TYPE_GROUP = 1;
     private static final int VIEW_TYPE_ACTIONS = 2;
@@ -167,33 +174,33 @@ public class PromptListAdapter extends A
         }
         return -1;
     }
 
     private View getActionView(PromptListItem item, final ListView list, final int position) {
         final GeckoActionProvider provider = GeckoActionProvider.getForType(item.getIntent().getType(), getContext());
         provider.setIntent(item.getIntent());
 
-        final MenuItemSwitcherLayout view = (MenuItemSwitcherLayout) provider.onCreateActionView(
+        final MenuItemActionView view = (MenuItemActionView) provider.onCreateActionView(
                 GeckoActionProvider.ActionViewType.CONTEXT_MENU);
         // If a quickshare button is clicked, we need to close the dialog.
         view.addActionButtonClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 ListView.OnItemClickListener listener = list.getOnItemClickListener();
                 if (listener != null) {
                     listener.onItemClick(list, view, position, position);
                 }
             }
         });
 
         return view;
     }
 
-    private void updateActionView(final PromptListItem item, final MenuItemSwitcherLayout view, final ListView list, final int position) {
+    private void updateActionView(final PromptListItem item, final MenuItemActionView view, final ListView list, final int position) {
         view.setTitle(item.label);
         view.setIcon(item.getIcon());
         view.setSubMenuIndicator(item.isParent);
 
         // If the share button is clicked, we need to close the dialog and then show an intent chooser
         view.setMenuItemClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -248,17 +255,17 @@ public class PromptListAdapter extends A
 
                 convertView.setTag(viewHolder);
             }
         } else {
             viewHolder = (ViewHolder) convertView.getTag();
         }
 
         if (type == VIEW_TYPE_ACTIONS) {
-            updateActionView(item, (MenuItemSwitcherLayout) convertView, (ListView) parent, position);
+            updateActionView(item, (MenuItemActionView) convertView, (ListView) parent, position);
         } else {
             viewHolder.textView.setText(item.label);
             maybeUpdateCheckedState((ListView) parent, position, item, viewHolder);
             maybeUpdateIcon(item, viewHolder.textView);
         }
 
         return convertView;
     }
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/layout/menu_item_action_view.xml
@@ -0,0 +1,32 @@
+<?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">
+
+    <!-- Application icons will be added dynamically -->
+
+    <FrameLayout android:layout_width="0dip"
+                 android:layout_height="@dimen/menu_item_row_height"
+                 android:layout_weight="1.0">
+
+        <org.mozilla.gecko.menu.MenuItemDefault
+                android:id="@+id/menu_item"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@drawable/menu_item_action_bar_bg"
+                android:clickable="true"
+                android:focusable="true"/>
+
+        <org.mozilla.gecko.menu.MenuItemActionBar
+                style="@style/Widget.MenuItemSecondaryActionBar"
+                android:id="@+id/menu_item_button"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_gravity="center_vertical"
+                android:visibility="gone"/>
+
+    </FrameLayout>
+
+</merge>
deleted file mode 100644
--- a/mobile/android/base/resources/layout/menu_item_switcher_layout.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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">
-
-    <!-- Application icons will be added dynamically -->
-
-    <FrameLayout android:layout_width="0dip"
-                 android:layout_height="@dimen/menu_item_row_height"
-                 android:layout_weight="1.0">
-
-        <org.mozilla.gecko.menu.MenuItemDefault
-                android:id="@+id/menu_item"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:background="@drawable/menu_item_action_bar_bg"
-                android:clickable="true"
-                android:focusable="true"/>
-
-        <org.mozilla.gecko.menu.MenuItemActionBar
-                style="@style/Widget.MenuItemSecondaryActionBar"
-                android:id="@+id/menu_item_button"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_gravity="center_vertical"
-                android:visibility="gone"/>
-
-    </FrameLayout>
-
-</merge>
--- a/mobile/android/base/resources/values-v11/themes.xml
+++ b/mobile/android/base/resources/values-v11/themes.xml
@@ -39,15 +39,15 @@
         <item name="android:actionButtonStyle">@style/GeckoActionBar.Button</item>
         <item name="android:actionModeCopyDrawable">@drawable/ab_copy</item>
         <item name="android:actionModeCutDrawable">@drawable/ab_cut</item>
         <item name="android:actionModePasteDrawable">@drawable/ab_paste</item>
         <item name="android:listViewStyle">@style/Widget.ListView</item>
         <item name="android:panelBackground">@drawable/menu_panel_bg</item>
         <item name="android:spinnerDropDownItemStyle">@style/Widget.DropDownItem.Spinner</item>
         <item name="android:spinnerItemStyle">@style/Widget.TextView.SpinnerItem</item>
-        <item name="menuItemSwitcherLayoutStyle">@style/Widget.MenuItemSwitcherLayout</item>
+        <item name="menuItemActionViewStyle">@style/Widget.MenuItemActionView</item>
         <item name="menuItemDefaultStyle">@style/Widget.MenuItemDefault</item>
         <item name="menuItemSecondaryActionBarStyle">@style/Widget.MenuItemSecondaryActionBar</item>
         <item name="tabGridLayoutViewStyle">@style/Widget.TabsGridLayout</item>
     </style>
 
 </resources>
--- a/mobile/android/base/resources/values-v14/themes.xml
+++ b/mobile/android/base/resources/values-v14/themes.xml
@@ -15,14 +15,14 @@
         <item name="android:actionModeCutDrawable">@drawable/ab_cut</item>
         <item name="android:actionModePasteDrawable">@drawable/ab_paste</item>
         <item name="android:actionModeSelectAllDrawable">@drawable/ab_select_all</item>
         <item name="android:actionModeStyle">@style/GeckoActionBar</item>
         <item name="android:listViewStyle">@style/Widget.ListView</item>
         <item name="android:panelBackground">@drawable/menu_panel_bg</item>
         <item name="android:spinnerDropDownItemStyle">@style/Widget.DropDownItem.Spinner</item>
         <item name="android:spinnerItemStyle">@style/Widget.TextView.SpinnerItem</item>
-        <item name="menuItemSwitcherLayoutStyle">@style/Widget.MenuItemSwitcherLayout</item>
+        <item name="menuItemActionViewStyle">@style/Widget.MenuItemActionView</item>
         <item name="menuItemDefaultStyle">@style/Widget.MenuItemDefault</item>
         <item name="menuItemSecondaryActionBarStyle">@style/Widget.MenuItemSecondaryActionBar</item>
     </style>
 
 </resources>
--- a/mobile/android/base/resources/values-v21/themes.xml
+++ b/mobile/android/base/resources/values-v21/themes.xml
@@ -35,15 +35,15 @@
     </style>
 
     <style name="GeckoAppBase" parent="Gecko">
         <item name="android:actionButtonStyle">@style/GeckoActionBar.Button</item>
         <item name="android:listViewStyle">@style/Widget.ListView</item>
         <item name="android:panelBackground">@drawable/menu_panel_bg</item>
         <item name="android:spinnerDropDownItemStyle">@style/Widget.DropDownItem.Spinner</item>
         <item name="android:spinnerItemStyle">@style/Widget.TextView.SpinnerItem</item>
-        <item name="menuItemSwitcherLayoutStyle">@style/Widget.MenuItemSwitcherLayout</item>
+        <item name="menuItemActionViewStyle">@style/Widget.MenuItemActionView</item>
         <item name="menuItemDefaultStyle">@style/Widget.MenuItemDefault</item>
         <item name="menuItemSecondaryActionBarStyle">@style/Widget.MenuItemSecondaryActionBar</item>
         <item name="tabGridLayoutViewStyle">@style/Widget.TabsGridLayout</item>
     </style>
 
 </resources>
--- a/mobile/android/base/resources/values/attrs.xml
+++ b/mobile/android/base/resources/values/attrs.xml
@@ -11,26 +11,26 @@
         <attr name="geckoMenuListViewStyle" format="reference"/>
 
         <!-- Style for MenuItemActionBar -->
         <attr name="menuItemActionBarStyle" format="reference"/>
 
         <!-- Style for MenuItemActionBar -->
         <attr name="menuItemActionModeStyle" format="reference"/>
 
-        <!-- Style for MenuItemSwitcherLayout -->
-        <attr name="menuItemSwitcherLayoutStyle" format="reference"/>
+        <!-- Style for MenuItemActionView -->
+        <attr name="menuItemActionViewStyle" format="reference"/>
 
         <!-- Style for MenuItemDefault -->
         <attr name="menuItemDefaultStyle" format="reference"/>
 
         <!-- Style for MenuItemActionBar when shown in SecondaryActionBar -->
         <attr name="menuItemSecondaryActionBarStyle" format="reference"/>
 
-        <!-- Style for MenuItemSwitcherLayout's ShareActionButton -->
+        <!-- Style for MenuItemActionView's ShareActionButton -->
         <attr name="menuItemShareActionButtonStyle" format="reference"/>
 
         <!-- Default style for the BookmarksListView -->
         <attr name="bookmarksListViewStyle" format="reference" />
 
         <!-- Default style for the TopSitesGridItemView -->
         <attr name="topSitesGridItemViewStyle" format="reference" />
 
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -94,17 +94,17 @@
 
     <style name="Widget.MenuItemSecondaryActionBar">
         <item name="android:padding">8dip</item>
         <item name="android:background">@drawable/menu_item_action_bar_bg</item>
         <item name="android:scaleType">centerInside</item>
         <item name="drawableTintList">@color/action_bar_secondary_menu_item_colors</item>
     </style>
 
-    <style name="Widget.MenuItemSwitcherLayout">
+    <style name="Widget.MenuItemActionView">
         <item name="android:gravity">left</item>
     </style>
 
     <style name="Widget.MenuItemDefault">
         <item name="android:paddingLeft">15dip</item>
         <item name="android:paddingRight">10dip</item>
         <item name="android:drawablePadding">6dip</item>
         <item name="android:gravity">center_vertical</item>
--- a/mobile/android/base/widget/GeckoActionProvider.java
+++ b/mobile/android/base/widget/GeckoActionProvider.java
@@ -5,17 +5,18 @@
 
 package org.mozilla.gecko.widget;
 
 import android.view.Menu;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
-import org.mozilla.gecko.menu.MenuItemSwitcherLayout;
+import org.mozilla.gecko.menu.MenuItemActionView;
+import org.mozilla.gecko.overlays.ui.ShareDialog;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.view.MenuItem;
 import android.view.MenuItem.OnMenuItemClickListener;
@@ -86,24 +87,24 @@ public class GeckoActionProvider {
     }
 
     /**
      * Creates the action view using the default history size.
      */
     public View onCreateActionView(final ActionViewType viewType) {
         // Create the view and set its data model.
         ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
-        final MenuItemSwitcherLayout view;
+        final MenuItemActionView view;
         switch (viewType) {
             case DEFAULT:
-                view = new MenuItemSwitcherLayout(mContext, null);
+                view = new MenuItemActionView(mContext, null);
                 break;
 
             case CONTEXT_MENU:
-                view = new MenuItemSwitcherLayout(mContext, null);
+                view = new MenuItemActionView(mContext, null);
                 view.initContextMenuStyles();
                 break;
 
             default:
                 throw new IllegalArgumentException(
                         "Unknown " + ActionViewType.class.getSimpleName() + ": " + viewType);
         }
         view.addActionButtonClickListener(mCallbacks);