diff options
author | dgwallinga@chromium.org <dgwallinga@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-30 21:33:08 +0000 |
---|---|---|
committer | dgwallinga@chromium.org <dgwallinga@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-30 21:33:08 +0000 |
commit | 17b6be77f10220c35d5eda624a8d4570ea4bdfbc (patch) | |
tree | 3507ab64be5f535faa677529f80aab9195a7256b /components/autofill/browser/autofill_manager.cc | |
parent | e7bd97ddcf62efc9f737c537cd0e92f1712d400f (diff) | |
download | chromium_src-17b6be77f10220c35d5eda624a8d4570ea4bdfbc.zip chromium_src-17b6be77f10220c35d5eda624a8d4570ea4bdfbc.tar.gz chromium_src-17b6be77f10220c35d5eda624a8d4570ea4bdfbc.tar.bz2 |
Requery the autofill server when forms and input fields are dynamically added.
BUG=224802
Review URL: https://chromiumcodereview.appspot.com/13264002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill/browser/autofill_manager.cc')
-rw-r--r-- | components/autofill/browser/autofill_manager.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/components/autofill/browser/autofill_manager.cc b/components/autofill/browser/autofill_manager.cc index 20c16e8..f2e2907 100644 --- a/components/autofill/browser/autofill_manager.cc +++ b/components/autofill/browser/autofill_manager.cc @@ -381,17 +381,28 @@ bool AutofillManager::OnFormSubmitted(const FormData& form, void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, const TimeTicks& timestamp, - bool has_more_forms) { + autofill::FormsSeenState state) { + bool is_post_document_load = state == autofill::DYNAMIC_FORMS_SEEN; + bool has_more_forms = state == autofill::PARTIAL_FORMS_SEEN; + // If new forms were added via AJAX or DHML, treat as new page. + if (is_post_document_load) + Reset(); + RenderViewHost* host = web_contents()->GetRenderViewHost(); if (!host) return; if (!GetAutocheckoutURLPrefix().empty()) { // If whitelisted URL, fetch all the forms. - if (has_more_forms) { + if (has_more_forms) host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); - return; + if (!is_post_document_load) { + host->Send( + new AutofillMsg_AutocheckoutSupported(host->GetRoutingID())); } + // Now return early, as OnFormsSeen will get called again with all forms. + if (has_more_forms) + return; } autocheckout_manager_.OnFormsSeen(); |