Update logic for calculating drag handle anchor bounds
Drag handle is used as an anchor for in-app to home contextual nudge, and for login shelf swipe contextual nudge. By default, anchor bounds are derived from the anchor's bounds in screen. This generally works, but due to the way shelf widget (who owns the drag handled) bounds are animated, relying on bounds in screen could end up misplacing the contextual nudge widget when bounds change. The shelf widget is animated by setting it's target bounds, and then animating a transform that matches the current shelf position to the identity transform. This means that when the widget bounds are set, the widget might have non-identity transform. GetBoundsInScreen will take that transform into account, and cause the nudge widget to be positioned relative to the current widget position, instead of the target one. This updates the logic for calculating drag handle anchor bounds to ignore the shelf widget transforms. Additionally, it is changed to ignore the drag handle's transform as well - the drag handle gets translated using a transform when in-app to home nudge is shown, but the nudge bounds are set relative to the handle bounds with no transform, and in addition have the identical transform set. BUG=1058615 Change-Id: I1e398cf2e0d149c0bb9b2bea22651196a26b89fa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091271 Commit-Queue: Toni Baržić <tbarzic@chromium.org> Reviewed-by:Xiyuan Xia <xiyuan@chromium.org> Cr-Commit-Position: refs/heads/master@{#747823}
Showing
Please register or sign in to comment