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

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: 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 d2632fc6308f63cad5a94a4cbd83fe8e0a32e355..c8a0c783fca075f0eeb7fb1f168ee545d3c3e189 100644
--- a/components/autofill/browser/autofill_manager.cc
+++ b/components/autofill/browser/autofill_manager.cc
@@ -448,14 +448,19 @@ bool AutofillManager::OnFormSubmitted(const FormData& form,
void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms,
const TimeTicks& timestamp,
- bool has_more_forms) {
+ bool has_more_forms,
+ bool is_post_document_load) {
+ // if new forms are the result of AJAX or DHML, treat as new page.
ahutter 2013/03/29 19:48:31 "If new forms were added via AJAX or DHTML..."
Dane Wallinga 2013/03/29 21:41:12 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)
ahutter 2013/03/29 19:48:31 curlies since this is multiline
Dane Wallinga 2013/03/29 21:41:12 Even if it's just one statement with wrapping? Chr
+ 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