Bug 956858 - Make menu inaccessible during editing mode. r=wesj, a=bajaj
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 08 Jan 2014 14:11:58 -0800
changeset 167895 b40e5b4e6f4f146e8b873b9ef9cf512c4d30a455
parent 167894 d81ce166fe8e9b390c9401c5ad60a7c5f2e01adf
child 167896 c53d7e5c6e0c1d16c6ed7642806c080c892ecfc4
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj, bajaj
bugs956858
milestone27.0
Bug 956858 - Make menu inaccessible during editing mode. r=wesj, a=bajaj
mobile/android/base/BrowserApp.java
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1919,18 +1919,21 @@ abstract public class BrowserApp extends
             share.setActionProvider(provider);
         }
 
         return true;
     }
 
     @Override
     public void openOptionsMenu() {
-        if (!hasTabsSideBar() && areTabsShown())
+        // Disable menu access in edge cases only accessible to hardware menu buttons.
+        if ((!hasTabsSideBar() && areTabsShown()) ||
+                mBrowserToolbar.isEditing()) {
             return;
+        }
 
         // Scroll custom menu to the top
         if (mMenuPanel != null)
             mMenuPanel.scrollTo(0, 0);
 
         if (!mBrowserToolbar.openOptionsMenu())
             super.openOptionsMenu();
 
@@ -2369,17 +2372,17 @@ abstract public class BrowserApp extends
             }
         }).execute();
     }
 
     // HomePager.OnNewTabsListener
     @Override
     public void onNewTabs(String[] urls) {
         final EnumSet<OnUrlOpenListener.Flags> flags = EnumSet.of(OnUrlOpenListener.Flags.ALLOW_SWITCH_TO_TAB);
- 
+
         for (String url : urls) {
             if (!maybeSwitchToTab(url, flags)) {
                 openUrl(url, true);
             }
         }
     }
 
     // HomePager.OnUrlOpenListener
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -375,17 +375,17 @@ abstract public class GeckoApp
                 mMenuPanel = new MenuPanel(this, null);
             } else {
                 // Prepare the panel everytime before showing the menu.
                 onPreparePanel(featureId, mMenuPanel, mMenu);
             }
 
             return mMenuPanel; 
         }
-  
+
         return super.onCreatePanelView(featureId);
     }
 
     @Override
     public boolean onCreatePanelMenu(int featureId, Menu menu) {
         if (Build.VERSION.SDK_INT >= 11 && featureId == Window.FEATURE_OPTIONS_PANEL) {
             if (mMenuPanel == null) {
                 mMenuPanel = (MenuPanel) onCreatePanelView(featureId);