[iOS] Move toolbar layout to BVC.
The previous implementation of ToolbarView had a constraint that attempted to layout the view's height by constraining its bottom anchor to kToolbarHeight away from the top layout guide provided by the BVC. This is incorrect because when the page is scrolled, fullscreen will translate the toolbar up so that its bottom edge is less than its height away from the bottom of the top safe area inset. This CL updates ToolbarView to use |intrinsicContentSize| to specify kToolbarHeight as its minimum size (enforced via implicit compression resistance constraints created by returning a custom value for |intrinsicContentSize|). The remainder of the toolbar's layout is managed by constraints created by BVC: 1. |primaryToolbarHeightConstraint|, which accounts for the top layout guide's height. 2. |primaryToolbarOffsetConstraint|, which manages the vertical positioning of the toolbar. When a fullscreen progress value is observed, BVC updates this value to move the toolbar up and down. Note that the height never changes. 3. Leading and trailing constraints that match that of BVC's view so the toolbar's width spans the entire screen. Bug: 799907, 799117, 798496 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I6cf2c7e09d3a8324be4008f7be7c313231fabd43 Reviewed-on: https://chromium-review.googlesource.com/882135 Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org> Reviewed-by:Kurt Horimoto <kkhorimoto@chromium.org> Reviewed-by:
Justin Cohen <justincohen@chromium.org> Reviewed-by:
Gauthier Ambard <gambard@chromium.org> Cr-Commit-Position: refs/heads/master@{#532175}
Showing
Please register or sign in to comment