Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: components/autofill/browser/autofill_manager.cc

Issue 13264002: Requery the autofill server when forms and input fields are dynamically added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor style fix Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()));

Powered by Google App Engine
This is Rietveld 408576698