Skip to content

Commit

Permalink
[M115][DownloadBubble] Clear default button when buttons are cleared
Browse files Browse the repository at this point in the history
This clears the default button on the bubble dialog delegate when the
buttons are cleared (set to DIALOG_BUTTON_NONE). This avoids tripping
a CHECK where we crash when the default button is not among the buttons
present on the dialog.

(cherry picked from commit a339a05)

Bug: 1449354
Change-Id: Ia5064b80e0c8c56c08b69ee8df6b085436ffa267
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574027
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1150741}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4582987
Cr-Commit-Position: refs/branch-heads/5790@{#239}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
chlily1 authored and Chromium LUCI CQ committed Jun 1, 2023
1 parent 6cbd3fc commit f999a78
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -434,6 +434,7 @@ void DownloadToolbarButtonView::OpenPrimaryDialog() {
primary_view_->SetVisible(true);
security_view_->SetVisible(false);
bubble_delegate_->SetButtons(ui::DIALOG_BUTTON_NONE);
bubble_delegate_->SetDefaultButton(ui::DIALOG_BUTTON_NONE);
bubble_delegate_->set_margins(GetPrimaryViewMargin());
ResizeDialog();
}
Expand Down Expand Up @@ -488,6 +489,7 @@ void DownloadToolbarButtonView::CreateBubbleDialogDelegate(
bubble_delegate->SetShowTitle(false);
bubble_delegate->SetShowCloseButton(false);
bubble_delegate->SetButtons(ui::DIALOG_BUTTON_NONE);
bubble_delegate->SetDefaultButton(ui::DIALOG_BUTTON_NONE);
bubble_delegate->RegisterDeleteDelegateCallback(
base::BindOnce(&DownloadToolbarButtonView::OnBubbleDelegateDeleted,
weak_factory_.GetWeakPtr()));
Expand Down

0 comments on commit f999a78

Please sign in to comment.