diff options
author | gcasto@chromium.org <gcasto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-09 23:50:15 +0000 |
---|---|---|
committer | gcasto@chromium.org <gcasto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-09 23:50:15 +0000 |
commit | bbfabdaa8d4becca611df72934122087b0c3663c (patch) | |
tree | 60f28fe4bfe5dae80a7326a6f45d05d68c6a0622 /chrome/renderer/autofill | |
parent | a950369174ffb7a457364c70fd15ae56155beeed (diff) | |
download | chromium_src-bbfabdaa8d4becca611df72934122087b0c3663c.zip chromium_src-bbfabdaa8d4becca611df72934122087b0c3663c.tar.gz chromium_src-bbfabdaa8d4becca611df72934122087b0c3663c.tar.bz2 |
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
Diffstat (limited to 'chrome/renderer/autofill')
-rw-r--r-- | chrome/renderer/autofill/password_generation_manager.cc | 16 |
1 files changed, 10 insertions, 6 deletions
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) { |