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

payments: migrate GetDialogButtonLabel -> set_button_label

While the Ok/Cancel messages appear to be dynamically computed, in fact this
dialog never calls DialogModelChanged, so the initial messages are always the
ones used. As such, this change will cause no behavior difference.

Bug: 1011446
Change-Id: Ib23484c83eaa8c64b8e5062d922b0365b4e65d66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854684Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706517}
parent 35edf353
...@@ -352,6 +352,9 @@ LocalCardMigrationDialogView::LocalCardMigrationDialogView( ...@@ -352,6 +352,9 @@ LocalCardMigrationDialogView::LocalCardMigrationDialogView(
LocalCardMigrationDialogController* controller, LocalCardMigrationDialogController* controller,
content::WebContents* web_contents) content::WebContents* web_contents)
: controller_(controller), web_contents_(web_contents) { : controller_(controller), web_contents_(web_contents) {
DialogDelegate::set_button_label(ui::DIALOG_BUTTON_OK, GetOkButtonLabel());
DialogDelegate::set_button_label(ui::DIALOG_BUTTON_CANCEL,
GetCancelButtonLabel());
set_close_on_deactivate(false); set_close_on_deactivate(false);
set_margins(gfx::Insets()); set_margins(gfx::Insets());
} }
...@@ -395,12 +398,6 @@ int LocalCardMigrationDialogView::GetDialogButtons() const { ...@@ -395,12 +398,6 @@ int LocalCardMigrationDialogView::GetDialogButtons() const {
return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
} }
base::string16 LocalCardMigrationDialogView::GetDialogButtonLabel(
ui::DialogButton button) const {
return button == ui::DIALOG_BUTTON_OK ? GetOkButtonLabel()
: GetCancelButtonLabel();
}
// TODO(crbug.com/867194): Update this method when adding feedback. // TODO(crbug.com/867194): Update this method when adding feedback.
bool LocalCardMigrationDialogView::IsDialogButtonEnabled( bool LocalCardMigrationDialogView::IsDialogButtonEnabled(
ui::DialogButton button) const { ui::DialogButton button) const {
......
...@@ -38,7 +38,6 @@ class LocalCardMigrationDialogView : public LocalCardMigrationDialog, ...@@ -38,7 +38,6 @@ class LocalCardMigrationDialogView : public LocalCardMigrationDialog,
ui::ModalType GetModalType() const override; ui::ModalType GetModalType() const override;
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
int GetDialogButtons() const override; int GetDialogButtons() const override;
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
bool IsDialogButtonEnabled(ui::DialogButton button) const override; bool IsDialogButtonEnabled(ui::DialogButton button) const override;
bool Accept() override; bool Accept() override;
bool Cancel() override; bool Cancel() 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