Bug 1015450 - Prevent toolbar from going into an inconsistent state when tapped when entering editing mode. r=lucasr, a=sledru
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 30 May 2014 09:42:41 -0700
changeset 200450 09f2b783db0995e5227920fb617c2cbd5545589a
parent 200449 e4c35c06468d23aa5dda01dc73e14acc7fa7df93
child 200451 6f561fd4e04525750c614a9c47a4a2dd908698e5
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, sledru
bugs1015450
milestone31.0a2
Bug 1015450 - Prevent toolbar from going into an inconsistent state when tapped when entering editing mode. r=lucasr, a=sledru
mobile/android/base/BrowserApp.java
mobile/android/base/toolbar/BrowserToolbar.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1517,16 +1517,20 @@ abstract public class BrowserApp extends
      * Enters editing mode with the specified URL. This method will
      * always open the HISTORY page on about:home.
      */
     private void enterEditingMode(String url) {
         if (url == null) {
             throw new IllegalArgumentException("Cannot handle null URLs in enterEditingMode");
         }
 
+        if (mBrowserToolbar.isEditing() || mBrowserToolbar.isAnimating()) {
+            return;
+        }
+
         final Tab selectedTab = Tabs.getInstance().getSelectedTab();
         mTargetTabForEditingMode = (selectedTab != null ? selectedTab.getId() : null);
 
         final PropertyAnimator animator = new PropertyAnimator(250);
         animator.setUseHardwareLayer(false);
 
         mBrowserToolbar.startEditing(url, animator);
 
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -928,16 +928,20 @@ public class BrowserToolbar extends Them
     /**
      * Returns whether or not the URL bar is in editing mode (url bar is expanded, hiding the new
      * tab button). Note that selection state is independent of editing mode.
      */
     public boolean isEditing() {
         return (uiMode == UIMode.EDIT);
     }
 
+    public boolean isAnimating() {
+        return isAnimatingEntry;
+    }
+
     public void startEditing(String url, PropertyAnimator animator) {
         if (isEditing()) {
             return;
         }
 
         urlEditLayout.setText(url != null ? url : "");
 
         setUIMode(UIMode.EDIT);