From bbfabdaa8d4becca611df72934122087b0c3663c Mon Sep 17 00:00:00 2001 From: "gcasto@chromium.org" Date: Mon, 9 Jul 2012 23:50:15 +0000 Subject: Fix PasswordGenerationManager so that it doesn't clear state recieved from the PasswordManager on every iframe load. BUG= TEST=PasswordGenerationBrowserTest Review URL: https://chromiumcodereview.appspot.com/10696102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145795 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/autofill/password_generation_manager.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'chrome/renderer/autofill') diff --git a/chrome/renderer/autofill/password_generation_manager.cc b/chrome/renderer/autofill/password_generation_manager.cc index 15608e1..7e402e2 100644 --- a/chrome/renderer/autofill/password_generation_manager.cc +++ b/chrome/renderer/autofill/password_generation_manager.cc @@ -67,12 +67,16 @@ void PasswordGenerationManager::DidFinishDocumentLoad(WebKit::WebFrame* frame) { // In every navigation, the IPC message sent by the password autofill manager // to query whether the current form is blacklisted or not happens when the // document load finishes, so we need to clear previous states here before we - // hear back from the browser. Note that we assume there is only one account - // creation form, but there could be multiple password forms in each frame. - not_blacklisted_password_form_origins_.clear(); - // Initialize to an empty and invalid GURL. - account_creation_form_origin_ = GURL(); - passwords_.clear(); + // hear back from the browser. We only clear this state on main frame load + // as we don't want subframe loads to clear state that we have recieved from + // the main frame. Note that we assume there is only one account creation + // form, but there could be multiple password forms in each frame. + if (!frame->parent()) { + not_blacklisted_password_form_origins_.clear(); + // Initialize to an empty and invalid GURL. + account_creation_form_origin_ = GURL(); + passwords_.clear(); + } } void PasswordGenerationManager::DidFinishLoad(WebKit::WebFrame* frame) { -- cgit v1.1