• bauerb's avatar
    Use only toolbar to transition from fakebox to real omnibox. · 7a676cfc
    bauerb authored
    Previously, we would fade out the fakebox and fade in the real omnibox during
    the scroll transition, which created discrepancies. With this change, the
    toolbar omnibox does the full transition. The search box on the NTP is still
    kept, both to get the starting point of the transition, and for the tablet
    toolbar, where the omnibox stays at the top, so there are two boxes.
    
    Because the two boxes now have to match, their dimensions and padding are
    slightly updated. The height is 56dp, and the padding on the sides is 12dp.
    
    Also, in the focused state the omnibox now has 1dp bleed at the sides,
    which moves the rounded corners out of view.
    
    The remaining changes are not user-visible:
    * Opacity of the fakebox is now driven by the toolbar. This lets us centralize
      the logic (the toolbar can decide its own opacity and the opacity of the
      fakebox) and use different behavior on tablets, where the fakebox will simply
      fade out as before.
    * Rename variables to (hopefully) make them more consistent / self-explanatory.
    * |mLocationBarBackgroundBounds| (formerly |mUrlViewportBounds|) more accurately
      reflects the visible omnibox bounds in the absence of the NTP / when the NTP
      is scrolled so that the omnibox is at the top. To do that, we no longer
      include the Y translation we apply to position it where the fakebox is (it's
      instead applied to the |mLocationBarBackgroundNtpOffset|), and we always use
      an expansion value of 1 if the current tab is an NTP.
    * Remove the |inset_textbox| drawable -- it was the same as |textbox|, but with
      a margin added at the top and bottom (but *not* left or right). Since we
      calculate the omnibox bounds manually anyway, this allows us to account for
      the omnibox padding in the same way in either dimension.
    * Remove the |isInTabSwitcherMode| parameter from some methods in favor of using
      the member variable.
    
    BUG=605054,625108,618955,616728,612520
    
    Review-Url: https://codereview.chromium.org/2134663002
    Cr-Commit-Position: refs/heads/master@{#408885}
    7a676cfc
dimens.xml 18.7 KB