Backed out changeset 0117133ba8ef (bug 918007)
authorEd Morley <emorley@mozilla.com>
Wed, 23 Oct 2013 15:55:34 +0100
changeset 166572 5bafaa6987eb597dc19081bb27e1b1059cf2f2c8
parent 166571 4975704635c9528073a2c9b275b1c617351ab318
child 166573 2c803fb352c95b7343cb869885d75ef975feb1ba
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)
bugs918007
milestone27.0a1
backs out0117133ba8efeec277059f2f214b1fff55b5dd77
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
Backed out changeset 0117133ba8ef (bug 918007)
mobile/android/base/BrowserToolbar.java
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -1271,68 +1271,31 @@ public class BrowserToolbar extends Geck
                     ViewHelper.setAlpha(mGo, 1.0f);
                     showSoftInput();
                 }
             }
         });
     }
 
     /**
-     * Disables and dims all toolbar elements which are not
-     * related to editing mode.
-     */
-    private void updateChildrenForEditing() {
-        // This is for the tablet UI only
-        if (!HardwareUtils.isTablet()) {
-            return;
-        }
-
-        // Disable toolbar elemens while in editing mode
-        final boolean enabled = !mIsEditing;
-
-        // This alpha value has to be in sync with the one used
-        // in setButtonEnabled().
-        final float alpha = (enabled ? 1.0f : 0.24f);
-
-        mTabs.setEnabled(enabled);
-        ViewHelper.setAlpha(mTabsCounter, alpha);
-        mMenu.setEnabled(enabled);
-        ViewHelper.setAlpha(mMenuIcon, alpha);
-
-        final int actionItemsCount = mActionItemBar.getChildCount();
-        for (int i = 0; i < actionItemsCount; i++) {
-            mActionItemBar.getChildAt(i).setEnabled(enabled);
-        }
-        ViewHelper.setAlpha(mActionItemBar, alpha);
-
-        final Tab tab = Tabs.getInstance().getSelectedTab();
-        if (tab != null) {
-            setButtonEnabled(mBack, enabled && tab.canDoBack());
-            setButtonEnabled(mForward, enabled && tab.canDoForward());
-        }
-    }
-
-    /**
      * 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 mIsEditing;
     }
 
     public void startEditing(String url, PropertyAnimator animator) {
         if (isEditing()) {
             return;
         }
 
         mUrlEditText.setText(url != null ? url : "");
         mIsEditing = true;
 
-        updateChildrenForEditing();
-
         if (mStartEditingListener != null) {
             mStartEditingListener.onStartEditing();
         }
 
         final int entryTranslation = getUrlBarEntryTranslation();
         final int curveTranslation = getUrlBarCurveTranslation();
 
         // This animation doesn't make much sense in a sidebar UI
@@ -1435,18 +1398,16 @@ public class BrowserToolbar extends Geck
 
     private String stopEditing() {
         final String url = mUrlEditText.getText().toString();
         if (!isEditing()) {
             return url;
         }
         mIsEditing = false;
 
-        updateChildrenForEditing();
-
         if (mStopEditingListener != null) {
             mStopEditingListener.onStopEditing();
         }
 
         if (HardwareUtils.isTablet() || Build.VERSION.SDK_INT < 11) {
             hideUrlEditContainer();
 
             if (!HardwareUtils.isTablet()) {
@@ -1601,35 +1562,33 @@ public class BrowserToolbar extends Geck
         if (newInputType != currentInputType) {
             mUrlEditText.setRawInputType(newInputType);
         }
     }
 
     public void setButtonEnabled(ImageButton button, boolean enabled) {
         final Drawable drawable = button.getDrawable();
         if (drawable != null) {
-            // This alpha value has to be in sync with the one used
-            // in updateChildrenForEditing().
             drawable.setAlpha(enabled ? 255 : 61);
         }
 
         button.setEnabled(enabled);
     }
 
     public void updateBackButton(boolean enabled) {
         setButtonEnabled(mBack, enabled);
     }
 
     public void updateForwardButton(final boolean enabled) {
         if (mForward.isEnabled() == enabled)
             return;
 
         // Save the state on the forward button so that we can skip animations
         // when there's nothing to change
-        setButtonEnabled(mForward, enabled);
+        mForward.setEnabled(enabled);
 
         if (mForward.getVisibility() != View.VISIBLE)
             return;
 
         // We want the forward button to show immediately when switching tabs
         mForwardAnim = new PropertyAnimator(mSwitchingTabs ? 10 : FORWARD_ANIMATION_DURATION);
         final int width = mForward.getWidth() / 2;