Commit f57fe9cc authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cbuiv passwords: remove CredentialLeakDialogView GetDialogButtons

The value in the controller is const (yay!) so it's safe to simply set
it once in the constructor.

Bug: 1011446
Change-Id: I5d71936957717ccd5a15c1c81537f8d826d9b4ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2072663Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744386}
parent 756673ee
......@@ -80,6 +80,10 @@ CredentialLeakDialogView::CredentialLeakDialogView(
DCHECK(controller);
DCHECK(web_contents);
DialogDelegate::set_buttons(controller->ShouldShowCancelButton()
? ui::DIALOG_BUTTON_OK |
ui::DIALOG_BUTTON_CANCEL
: ui::DIALOG_BUTTON_OK);
DialogDelegate::set_button_label(ui::DIALOG_BUTTON_OK,
controller_->GetAcceptButtonLabel());
DialogDelegate::set_button_label(ui::DIALOG_BUTTON_CANCEL,
......@@ -137,14 +141,6 @@ gfx::Size CredentialLeakDialogView::CalculatePreferredSize() const {
return gfx::Size(width, GetHeightForWidth(width));
}
int CredentialLeakDialogView::GetDialogButtons() const {
// |controller_| can be nullptr when the framework calls this method after a
// button click.
return controller_ && controller_->ShouldShowCancelButton()
? ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL
: ui::DIALOG_BUTTON_OK;
}
bool CredentialLeakDialogView::ShouldShowCloseButton() const {
return false;
}
......
......@@ -30,7 +30,6 @@ class CredentialLeakDialogView : public views::DialogDelegateView,
// views::DialogDelegateView:
ui::ModalType GetModalType() const override;
gfx::Size CalculatePreferredSize() const override;
int GetDialogButtons() const override;
bool ShouldShowCloseButton() const override;
void OnThemeChanged() override;
base::string16 GetWindowTitle() const override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment