Backed out changesets 5fdcf5a9697f, da1a4740a722, and f16921967806 (bug 935628) for robocop failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 11 Nov 2013 15:56:27 -0500
changeset 154360 0053063dd87218879ad31d9bb6c09b016b185d86
parent 154359 ac79c0e3b30ff485f63eb9cd2f6999f66471b5d7
child 154430 23e20f2d1bf6ae44d94051c46bd0d8871c6411a2
child 154455 80d56658be91f6c29c8d98ea865d2f4c5b430576
push id3462
push userryanvm@gmail.com
push dateMon, 11 Nov 2013 20:57:07 +0000
treeherderfx-team@0053063dd872 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs935628
milestone28.0a1
backs out5fdcf5a9697feac43370e3f871da844c623827a6
da1a4740a72209c41f0314d6a45311e279d9dee1
f16921967806d5dfd9e40dae2c5c04a14f550d8a
Backed out changesets 5fdcf5a9697f, da1a4740a722, and f16921967806 (bug 935628) for robocop failures. CLOSED TREE
mobile/android/base/BrowserApp.java
mobile/android/base/BrowserToolbar.java
mobile/android/base/BrowserToolbarBackground.java
mobile/android/base/moz.build
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
mobile/android/base/resources/layout/browser_toolbar.xml
mobile/android/base/resources/layout/gecko_app.xml
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1,17 +1,16 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * 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;
 
 import org.mozilla.gecko.animation.PropertyAnimator;
-import org.mozilla.gecko.animation.ViewHelper;
 import org.mozilla.gecko.db.BrowserContract.Combined;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.favicons.Favicons;
 import org.mozilla.gecko.favicons.OnFaviconLoadedListener;
 import org.mozilla.gecko.favicons.LoadFaviconTask;
 import org.mozilla.gecko.gfx.BitmapUtils;
 import org.mozilla.gecko.gfx.GeckoLayerClient;
 import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
@@ -657,17 +656,17 @@ abstract public class BrowserApp extends
         } else {
             // Immediately show the toolbar when disabling the dynamic
             // toolbar.
             if (mLayerView != null) {
                 mLayerView.getLayerClient().setOnMetricsChangedListener(null);
             }
             mHomePagerContainer.setPadding(0, 0, 0, 0);
             if (mBrowserToolbar != null) {
-                ViewHelper.setTranslationY(mBrowserToolbar, 0);
+                mBrowserToolbar.scrollTo(0, 0);
             }
         }
 
         refreshToolbarHeight();
     }
 
     private boolean isDynamicToolbarEnabled() {
         return mDynamicToolbarEnabled && !mAccessibilityEnabled;
@@ -915,17 +914,17 @@ abstract public class BrowserApp extends
         } else {
             mDynamicToolbarCanScroll = true;
         }
 
         final View toolbarLayout = mBrowserToolbar;
         final int marginTop = Math.round(aMetrics.marginTop);
         ThreadUtils.postToUiThread(new Runnable() {
             public void run() {
-                ViewHelper.setTranslationY(toolbarLayout, marginTop - toolbarLayout.getHeight());
+                toolbarLayout.scrollTo(0, toolbarLayout.getHeight() - marginTop);
             }
         });
 
         if (mFormAssistPopup != null)
             mFormAssistPopup.onMetricsChanged(aMetrics);
     }
 
     @Override
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -115,16 +115,17 @@ public class BrowserToolbar extends Geck
         public void onStopEditing();
     }
 
     private View mUrlDisplayContainer;
     private View mUrlEditContainer;
     private CustomEditText mUrlEditText;
     private View mUrlBarEntry;
     private ImageView mUrlBarRightEdge;
+    private BrowserToolbarBackground mUrlBarBackground;
     private GeckoTextView mTitle;
     private int mTitlePadding;
     private boolean mSiteSecurityVisible;
     private boolean mSwitchingTabs;
     private ShapedButton mTabs;
     private ImageButton mBack;
     private ImageButton mForward;
     private ImageButton mFavicon;
@@ -179,30 +180,27 @@ public class BrowserToolbar extends Geck
     private static final int TABS_EXPANDED = 2;
 
     private static final int FORWARD_ANIMATION_DURATION = 450;
     private final ForegroundColorSpan mUrlColor;
     private final ForegroundColorSpan mBlockedColor;
     private final ForegroundColorSpan mDomainColor;
     private final ForegroundColorSpan mPrivateDomainColor;
 
-    private final LightweightTheme mTheme;
-
     private boolean mShowUrl;
     private boolean mTrimURLs;
 
     private Integer mPrefObserverId;
 
     public BrowserToolbar(Context context) {
         this(context, null);
     }
 
     public BrowserToolbar(Context context, AttributeSet attrs) {
         super(context, attrs);
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
 
         // BrowserToolbar is attached to BrowserApp only.
         mActivity = (BrowserApp) context;
 
         // Inflate the content.
         LayoutInflater.from(context).inflate(R.layout.browser_toolbar, this);
 
         Tabs.registerOnTabsChangedListener(this);
@@ -269,16 +267,17 @@ public class BrowserToolbar extends Geck
 
         registerEventListener("Reader:Click");
         registerEventListener("Reader:LongClick");
 
         mShowSiteSecurity = false;
 
         mAnimatingEntry = false;
 
+        mUrlBarBackground = (BrowserToolbarBackground) findViewById(R.id.url_bar_bg);
         mUrlBarViewOffset = res.getDimensionPixelSize(R.dimen.url_bar_offset_left);
         mDefaultForwardMargin = res.getDimensionPixelSize(R.dimen.forward_default_offset);
         mUrlDisplayContainer = findViewById(R.id.url_display_container);
         mUrlBarEntry = findViewById(R.id.url_bar_entry);
 
         mUrlEditContainer = findViewById(R.id.url_edit_container);
         mUrlEditText = (CustomEditText) findViewById(R.id.url_edit_text);
 
@@ -1352,20 +1351,16 @@ public class BrowserToolbar extends Geck
         mIsEditing = true;
 
         updateChildrenForEditing();
 
         if (mStartEditingListener != null) {
             mStartEditingListener.onStartEditing();
         }
 
-        if (mUrlBarRightEdge != null) {
-            mUrlBarRightEdge.setVisibility(View.VISIBLE);
-        }
-
         final int entryTranslation = getUrlBarEntryTranslation();
         final int curveTranslation = getUrlBarCurveTranslation();
 
         // This animation doesn't make much sense in a sidebar UI
         if (HardwareUtils.isTablet() || Build.VERSION.SDK_INT < 11) {
             showUrlEditContainer();
 
             if (!HardwareUtils.isTablet()) {
@@ -1533,20 +1528,16 @@ public class BrowserToolbar extends Geck
 
         contentAnimator.addPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {
             @Override
             public void onPropertyAnimationStart() {
             }
 
             @Override
             public void onPropertyAnimationEnd() {
-                if (mUrlBarRightEdge != null) {
-                    mUrlBarRightEdge.setVisibility(View.INVISIBLE);
-                }
-
                 PropertyAnimator buttonsAnimator = new PropertyAnimator(300);
 
                 // Fade toolbar buttons (page actions, stop) after the entry
                 // is schrunk back to its original size.
                 buttonsAnimator.attach(mPageActionLayout,
                                        PropertyAnimator.Property.ALPHA,
                                        1);
                 buttonsAnimator.attach(mStop,
@@ -1784,16 +1775,17 @@ public class BrowserToolbar extends Geck
             setFavicon(tab.getFavicon());
             setProgressVisibility(tab.getState() == Tab.STATE_LOADING);
             setSecurityMode(tab.getSecurityMode());
             setPageActionVisibility(mStop.getVisibility() == View.VISIBLE);
             updateBackButton(canDoBack(tab));
             updateForwardButton(canDoForward(tab));
 
             final boolean isPrivate = tab.isPrivate();
+            mUrlBarBackground.setPrivateMode(isPrivate);
             setPrivateMode(isPrivate);
             mTabs.setPrivateMode(isPrivate);
             mTitle.setPrivateMode(isPrivate);
             mMenu.setPrivateMode(isPrivate);
             mMenuIcon.setPrivateMode(isPrivate);
             mUrlEditText.setPrivateMode(isPrivate);
 
             if (mBack instanceof BackButton)
@@ -1871,27 +1863,9 @@ public class BrowserToolbar extends Geck
             }
         } else if (event.equals("Reader:LongClick")) {
             Tab tab = Tabs.getInstance().getSelectedTab();
             if (tab != null) {
                 tab.addToReadingList();
             }
         }
     }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        Drawable drawable = mTheme.getDrawable(this);
-        if (drawable == null)
-            return;
-
-        StateListDrawable stateList = new StateListDrawable();
-        stateList.addState(PRIVATE_STATE_SET, getColorDrawable(R.color.background_private));
-        stateList.addState(EMPTY_STATE_SET, drawable);
-
-        setBackgroundDrawable(stateList);
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        setBackgroundResource(R.drawable.url_bar_bg);
-    }
 }
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/BrowserToolbarBackground.java
@@ -0,0 +1,39 @@
+/* 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;
+
+import org.mozilla.gecko.widget.GeckoLinearLayout;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.StateListDrawable;
+import android.util.AttributeSet;
+
+public class BrowserToolbarBackground extends GeckoLinearLayout {
+    private final LightweightTheme mTheme;
+
+    public BrowserToolbarBackground(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
+    }
+
+    @Override
+    public void onLightweightThemeChanged() {
+        final Drawable drawable = mTheme.getDrawable(this);
+        if (drawable == null)
+            return;
+
+        final StateListDrawable stateList = new StateListDrawable();
+        stateList.addState(PRIVATE_STATE_SET, getColorDrawable(R.color.background_private));
+        stateList.addState(EMPTY_STATE_SET, drawable);
+
+        setBackgroundDrawable(stateList);
+    }
+
+    @Override
+    public void onLightweightThemeReset() {
+        setBackgroundResource(R.drawable.url_bar_bg);
+    }
+}
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -89,16 +89,17 @@ gbjar.sources += [
     'animation/HeightChangeAnimation.java',
     'animation/PropertyAnimator.java',
     'animation/Rotate3DAnimation.java',
     'animation/ViewHelper.java',
     'BackButton.java',
     'BaseGeckoInterface.java',
     'BrowserApp.java',
     'BrowserToolbar.java',
+    'BrowserToolbarBackground.java',
     'CameraImageResultHandler.java',
     'CameraVideoResultHandler.java',
     'CanvasDelegate.java',
     'ContactService.java',
     'ContextGetter.java',
     'CustomEditText.java',
     'db/BrowserDB.java',
     'db/LocalBrowserDB.java',
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -1,16 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- 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/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
+    <org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/url_bar_bg"
+                                                android:layout_width="fill_parent"
+                                                android:layout_height="fill_parent"
+                                                android:background="@drawable/url_bar_bg"/>
+
     <org.mozilla.gecko.ShapedButton android:id="@+id/tabs"
                                     style="@style/UrlBar.ImageButton"
                                     android:layout_width="84dip"
                                     android:layout_alignParentLeft="true"
                                     gecko:curveTowards="left"
                                     android:background="@drawable/shaped_button"
                                     android:gravity="center_vertical"
                                     android:paddingLeft="6dip"
--- a/mobile/android/base/resources/layout/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout/browser_toolbar.xml
@@ -7,16 +7,21 @@
        xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
     <ImageButton android:id="@+id/back"
                  style="@style/UrlBar.ImageButton.Unused"/>
 
     <ImageButton android:id="@+id/forward"
                  style="@style/UrlBar.ImageButton.Unused"/>
 
+    <org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/url_bar_bg"
+                                                android:layout_width="fill_parent"
+                                                android:layout_height="fill_parent"
+                                                android:background="@drawable/url_bar_bg"/>
+
     <ImageView android:id="@+id/url_bar_entry"
                style="@style/UrlBar.Button"
                android:layout_marginLeft="4dp"
                android:layout_marginRight="-19dp"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                android:layout_centerVertical="true"
                android:layout_toLeftOf="@+id/tabs"
@@ -32,17 +37,16 @@
                android:layout_alignLeft="@id/url_bar_entry"
                android:layout_alignRight="@id/url_bar_entry"
                android:layout_alignTop="@id/url_bar_entry"
                android:layout_alignBottom="@id/url_bar_entry"
                android:paddingRight="4dp"
                android:duplicateParentState="true"
                android:clickable="false"
                android:focusable="false"
-               android:visibility="invisible"
                android:src="@drawable/url_bar_right_edge"
                android:scaleType="fitXY"/>
 
     <LinearLayout android:id="@+id/menu_items"
                   style="@style/UrlBar.ImageButton.Unused"/>
 
     <org.mozilla.gecko.ShapedButton android:id="@+id/menu"
                                     style="@style/UrlBar.ImageButton"
--- a/mobile/android/base/resources/layout/gecko_app.xml
+++ b/mobile/android/base/resources/layout/gecko_app.xml
@@ -67,18 +67,17 @@
              view. To make sure the EditText is not the first focusable view in
              the root view, BrowserToolbar should be specified as low in the
              view hierarchy as possible. -->
         <org.mozilla.gecko.BrowserToolbar android:id="@id/browser_toolbar"
                 style="@style/BrowserToolbar"
                 android:layout_width="fill_parent"
                 android:layout_height="@dimen/browser_toolbar_height"
                 android:clickable="true"
-                android:focusable="true"
-                android:background="@drawable/url_bar_bg"/>
+                android:focusable="true"/>
 
     </view>
 
     <LinearLayout android:id="@+id/toast"
                   style="@style/Toast">
 
         <TextView android:id="@+id/toast_message"
                   style="@style/ToastMessage" />