Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6071)

Unified Diff: chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc

Issue 151503006: Re-land r248110 with ASAN error fixed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: With Fix Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698