Bug 1106935 - Remove NewTabletUI branch in BrowserToolbarTabletBase. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 02 Apr 2015 16:20:14 -0700
changeset 256506 57c22ce3666a5f0774b3c9101e843bfb4f0495e2
parent 256505 c1befe2261fcebc08dd7df6b22c5a927308cbe0c
child 256507 dff4d833af14b53c8e1017497db038d0b6398a56
push id1483
push usermichael.l.comella@gmail.com
push dateFri, 10 Apr 2015 15:12:05 +0000
reviewersmhaigh
bugs1106935
milestone40.0a1
Bug 1106935 - Remove NewTabletUI branch in BrowserToolbarTabletBase. r=mhaigh
mobile/android/base/toolbar/BrowserToolbarTabletBase.java
--- a/mobile/android/base/toolbar/BrowserToolbarTabletBase.java
+++ b/mobile/android/base/toolbar/BrowserToolbarTabletBase.java
@@ -2,17 +2,16 @@
  * 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.toolbar;
 
 import java.util.Arrays;
 
-import org.mozilla.gecko.NewTabletUI;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.tabs.TabHistoryController;
 import org.mozilla.gecko.menu.MenuItemActionBar;
 
 import android.content.Context;
 import android.graphics.drawable.Drawable;
@@ -100,32 +99,18 @@ abstract class BrowserToolbarTabletBase 
     @Override
     public void removeActionItem(final View actionItem) {
         actionItemBar.removeView(actionItem);
     }
 
     @Override
     protected void updateNavigationButtons(final Tab tab) {
         setButtonEnabled(backButton, canDoBack(tab));
-
-        final boolean isForwardEnabled = canDoForward(tab);
-        if (!NewTabletUI.isEnabled(getContext())) {
-            if (forwardButton.isEnabled() != isForwardEnabled) {
-                // Save the state on the forward button so that we can skip animations
-                // when there's nothing to change
-                setButtonEnabled(forwardButton, isForwardEnabled);
-                animateForwardButton(
-                        isForwardEnabled ? ForwardButtonAnimation.SHOW : ForwardButtonAnimation.HIDE);
-            }
-        } else {
-            // I don't know the implications of changing this code on old tablet
-            // (and no one is going to thoroughly test it) so duplicate the code.
-            animateForwardButton(
-                    isForwardEnabled ? ForwardButtonAnimation.SHOW : ForwardButtonAnimation.HIDE);
-        }
+        animateForwardButton(
+                canDoForward(tab) ? ForwardButtonAnimation.SHOW : ForwardButtonAnimation.HIDE);
     }
 
     @Override
     public void setNextFocusDownId(int nextId) {
         super.setNextFocusDownId(nextId);
         backButton.setNextFocusDownId(nextId);
         forwardButton.setNextFocusDownId(nextId);
     }