Commit ca025d47 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Set Cancel as the default button for the external protocol dialog.

This ensures that users holding down the Enter or Space key cannot
accidentally trigger an external protocol launch.

BUG=865202

Change-Id: I2cec7b3c216b80641200c97dec2517a66b4e0b24
Reviewed-on: https://chromium-review.googlesource.com/1142705
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576340}
parent 13393cb7
...@@ -57,6 +57,10 @@ bool ExternalProtocolDialog::ShouldShowCloseButton() const { ...@@ -57,6 +57,10 @@ bool ExternalProtocolDialog::ShouldShowCloseButton() const {
return false; return false;
} }
int ExternalProtocolDialog::GetDefaultDialogButton() const {
return ui::DIALOG_BUTTON_CANCEL;
}
base::string16 ExternalProtocolDialog::GetDialogButtonLabel( base::string16 ExternalProtocolDialog::GetDialogButtonLabel(
ui::DialogButton button) const { ui::DialogButton button) const {
return delegate_->GetDialogButtonLabel(button); return delegate_->GetDialogButtonLabel(button);
......
...@@ -32,6 +32,7 @@ class ExternalProtocolDialog : public views::DialogDelegateView { ...@@ -32,6 +32,7 @@ class ExternalProtocolDialog : public views::DialogDelegateView {
// views::DialogDelegateView: // views::DialogDelegateView:
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
int GetDefaultDialogButton() const override;
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
base::string16 GetWindowTitle() const override; base::string16 GetWindowTitle() const 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