Chromium Code Reviews| 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; |
|
Ilya Sherman
2013/04/06 00:29:39
Since you're using this as a bitmask, please defin
Dane Wallinga
2013/04/08 22:55:50
Done.
|
| + // If new forms were added via AJAX or DHML, treat as new page. |
| + if (is_post_document_load) |
| + Reset(); |
|
Ilya Sherman
2013/04/06 00:29:39
What happens if the user is already interacting wi
Dane Wallinga
2013/04/08 22:55:50
Hmm, that depends very much on what we think the '
Ilya Sherman
2013/04/09 02:17:46
Reset() also throws away the list of form_structur
Dane Wallinga
2013/04/10 00:19:13
If we don't throw the list of form_structures_ awa
|
| + |
| 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())); |