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..de327eced40eb37b65b72f71bb1a655e65084ca5 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| |
Evan Stade
2014/01/31 22:39:57
nit: final punctuation.
Garrett Casto
2014/01/31 22:58:00
Done.
|
+ 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(); |