Chromium Code Reviews| 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..df62c414dbf9b39eff6347e4759f14bf4d49e020 100644 |
| --- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc |
| @@ -107,7 +107,12 @@ bool PasswordGenerationPopupControllerImpl::HandleKeyPressEvent( |
| case ui::VKEY_TAB: |
| // We supress tab if the password is selected because we will |
|
Evan Stade
2014/01/31 21:55:55
suppress
Garrett Casto
2014/01/31 22:01:41
Done.
|
| // automatically advance focus anyway. |
| - return PossiblyAcceptPassword(); |
| + if (PossiblyAcceptPassword()) { |
| + Hide(); |
| + return true; |
| + } else { |
| + return false; |
| + } |
| default: |
| return false; |
| } |
| @@ -131,7 +136,6 @@ void PasswordGenerationPopupControllerImpl::PasswordAccepted() { |
| web_contents()->GetRenderViewHost()->GetRoutingID(), |
| current_password_)); |
| password_manager_->SetFormHasGeneratedPassword(form_); |
| - Hide(); |
| } |
| int PasswordGenerationPopupControllerImpl::GetDesiredWidth() { |
| @@ -207,6 +211,10 @@ void PasswordGenerationPopupControllerImpl::Show() { |
| observer_->OnPopupShown(); |
| } |
| +void PasswordGenerationPopupControllerImpl::HideAndDestroy() { |
| + Hide(); |
| +} |
| + |
| void PasswordGenerationPopupControllerImpl::Hide() { |
| controller_common_.RemoveKeyPressCallback(); |
| @@ -242,8 +250,10 @@ void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint( |
| void PasswordGenerationPopupControllerImpl::AcceptSelectionAtPoint( |
| const gfx::Point& point) { |
| - if (password_bounds_.Contains(point)) |
| + if (password_bounds_.Contains(point)) { |
| PasswordAccepted(); |
| + Hide(); |
| + } |
| } |
| void PasswordGenerationPopupControllerImpl::SelectionCleared() { |