Commit 2c920ffc authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Hide "edit generated password" prompt when leaving the editing state.

It's questionable whether the popup should move back to the generation state.
Curently for automatic generation it does and the bug isn't observed. For
manual generation it doesn't and therefore the editing prompt remains open.
The CL fixes that.

Bug: 870217
Change-Id: Ib9758f87208d82fd8bd52cdcd1aef664d4f2cba5
Reviewed-on: https://chromium-review.googlesource.com/1160849Reviewed-by: default avatarIoana Pandele <ioanap@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580516}
parent d21535ea
...@@ -805,6 +805,12 @@ void ChromePasswordManagerClient::PasswordNoLongerGenerated( ...@@ -805,6 +805,12 @@ void ChromePasswordManagerClient::PasswordNoLongerGenerated(
BadMessageReason::CPMD_BAD_ORIGIN_PASSWORD_NO_LONGER_GENERATED)) BadMessageReason::CPMD_BAD_ORIGIN_PASSWORD_NO_LONGER_GENERATED))
return; return;
password_manager_.OnPasswordNoLongerGenerated(password_form); password_manager_.OnPasswordNoLongerGenerated(password_form);
PasswordGenerationPopupController* controller = popup_controller_.get();
if (controller &&
controller->state() ==
PasswordGenerationPopupController::kEditGeneratedPassword) {
HidePasswordGenerationPopup();
}
} }
const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { const GURL& ChromePasswordManagerClient::GetMainFrameURL() const {
......
...@@ -628,13 +628,14 @@ bool PasswordGenerationAgent::TextDidChangeInTextField( ...@@ -628,13 +628,14 @@ bool PasswordGenerationAgent::TextDidChangeInTextField(
} }
if (element.Value().IsEmpty()) { if (element.Value().IsEmpty()) {
// The call may pop up a generation prompt.
MaybeOfferAutomaticGeneration();
// Tell the browser that the state isn't "editing" anymore. The browser
// should hide the editing prompt if it wasn't replaced above.
if (password_is_generated_) { if (password_is_generated_) {
// User generated a password and then deleted it. // User generated a password and then deleted it.
PasswordNoLongerGenerated(); PasswordNoLongerGenerated();
} }
// Offer generation again.
MaybeOfferAutomaticGeneration();
} else if (password_is_generated_) { } else if (password_is_generated_) {
password_edited_ = true; password_edited_ = true;
// Mirror edits to any confirmation password fields. // Mirror edits to any confirmation password fields.
......
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