Skip to content

Commit 771f528

Browse files
chlily1Chromium LUCI CQ
authored and
Chromium LUCI CQ
committed
[DownloadBubble] Always invalidate layout when showing animation
This fixes a bug that caused the download animation to go up the left side of the window to (0, 0). By always invalidating the layout when the animation needs to be displayed, we will force Layout() to run first before the code that calculates the animation's position based on the view bounds. Bug: 1428369 Change-Id: Idb381181e3790b3b76f550c51368570b77e00d01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4375591 Commit-Queue: Lily Chen <chlily@chromium.org> Reviewed-by: Daniel Rubery <drubery@chromium.org> Cr-Commit-Position: refs/heads/main@{#1123095}
1 parent 1e42a8e commit 771f528

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,8 @@ void DownloadToolbarButtonView::Disable() {
278278
void DownloadToolbarButtonView::UpdateDownloadIcon(bool show_animation) {
279279
if (show_animation && gfx::Animation::ShouldRenderRichAnimation()) {
280280
has_pending_download_started_animation_ = true;
281-
if (!needs_layout()) {
282-
ShowPendingDownloadStartedAnimation();
283-
}
281+
// Invalidate the layout to show the animation in Layout().
282+
PreferredSizeChanged();
284283
}
285284
UpdateIcon();
286285
}

0 commit comments

Comments
 (0)