| Index: chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
|
| diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
|
| index 8d73906446dfe8ce6595f2279f802854edc1e979..1aa5dd6c04445a0644bd8559b8c59ac9ea0d0f2f 100644
|
| --- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
|
| +++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
|
| @@ -105,7 +105,7 @@ bool PasswordGenerationPopupControllerImpl::HandleKeyPressEvent(
|
| return true;
|
| case ui::VKEY_RETURN:
|
| case ui::VKEY_TAB:
|
| - // We supress tab if the password is selected because we will
|
| + // We suppress tab if the password is selected because we will
|
| // automatically advance focus anyway.
|
| return PossiblyAcceptPassword();
|
| default:
|
| @@ -114,10 +114,12 @@ bool PasswordGenerationPopupControllerImpl::HandleKeyPressEvent(
|
| }
|
|
|
| bool PasswordGenerationPopupControllerImpl::PossiblyAcceptPassword() {
|
| - if (password_selected_)
|
| - PasswordAccepted();
|
| + if (password_selected_) {
|
| + PasswordAccepted(); // This will delete |this|.
|
| + return true;
|
| + }
|
|
|
| - return password_selected_;
|
| + return false;
|
| }
|
|
|
| void PasswordGenerationPopupControllerImpl::PasswordSelected(bool selected) {
|
| @@ -207,6 +209,10 @@ void PasswordGenerationPopupControllerImpl::Show() {
|
| observer_->OnPopupShown();
|
| }
|
|
|
| +void PasswordGenerationPopupControllerImpl::HideAndDestroy() {
|
| + Hide();
|
| +}
|
| +
|
| void PasswordGenerationPopupControllerImpl::Hide() {
|
| controller_common_.RemoveKeyPressCallback();
|
|
|
|
|