| Index: components/autofill/browser/autofill_manager.cc
|
| diff --git a/components/autofill/browser/autofill_manager.cc b/components/autofill/browser/autofill_manager.cc
|
| index 3db909be9cc945cfbf022a187e50ae246b2f082c..a13ada31809bcf7482ae7ac544bff0f9f20a3204 100644
|
| --- a/components/autofill/browser/autofill_manager.cc
|
| +++ b/components/autofill/browser/autofill_manager.cc
|
| @@ -448,14 +448,22 @@ bool AutofillManager::OnFormSubmitted(const FormData& form,
|
|
|
| void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms,
|
| const TimeTicks& timestamp,
|
| - bool has_more_forms) {
|
| + autofill::FormsSeenParam param) {
|
| + bool is_post_document_load = param & autofill::DYNAMIC_FORMS_SEEN;
|
| + bool has_more_forms = param & 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()) {
|
| - host->Send(
|
| - new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID()));
|
| + if (!is_post_document_load) {
|
| + host->Send(
|
| + new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID()));
|
| + }
|
| // If whitelisted URL, fetch all the forms.
|
| if (has_more_forms) {
|
| host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID()));
|
|
|