Bug 1086981 - Part 5: Cancel editing mode when pressing the tabs panel button. r=lucasr
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 04 Nov 2014 04:02:02 -0800
changeset 213960 17033c6fae5b37991dd2e84fa383c5cccc9f07ef
parent 213959 5f3863fb4bb440021d5f7538e34ca62c141f1551
child 213961 ad0e861aede41612292aacf024c143e084ecf882
push id27769
push userkwierso@gmail.com
push dateWed, 05 Nov 2014 03:53:35 +0000
treeherdermozilla-central@62990ec7ad78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs1086981
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1086981 - Part 5: Cancel editing mode when pressing the tabs panel button. r=lucasr
mobile/android/base/BrowserApp.java
mobile/android/base/toolbar/BrowserToolbar.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1724,16 +1724,20 @@ public class BrowserApp extends GeckoApp
     public void onPropertyAnimationStart() {
     }
 
     @Override
     public void onPropertyAnimationEnd() {
         if (!areTabsShown()) {
             mTabsPanel.setVisibility(View.INVISIBLE);
             mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
+        } else {
+            // Cancel editing mode to return to page content when the TabsPanel closes. We cancel
+            // it here because there are graphical glitches if it's canceled while it's visible.
+            mBrowserToolbar.cancelEdit();
         }
 
         mTabsPanel.finishTabsAnimation();
 
         mMainLayoutAnimator = null;
     }
 
     @Override
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -310,16 +310,20 @@ public abstract class BrowserToolbar ext
                     focusChangeListener.onFocusChange(v, hasFocus);
                 }
             }
         });
 
         tabsButton.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View v) {
+                // Clear focus so a back press with the tabs
+                // panel open does not go to the editing field.
+                urlEditLayout.clearFocus();
+
                 toggleTabs();
             }
         });
         tabsButton.setImageLevel(0);
 
         editCancel.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {