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..4d1a0a42dcc2b805cc04668ec15cac0889a53d6c 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. |
Raman Kakilate
2013/04/02 20:30:19
nit: *I*f new forms...
Dane Wallinga
2013/04/02 21:29:30
Done.
|
+ 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())); |