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

Unified Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 2189513004: Blink: prevent didAssociateFormControls notification while parsing the document. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 4 years, 5 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/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index a287c5b45270323e479fe6957215b14d7df04a02..f1835d73cb94d9529610f896e277710fe2b6ca5a 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -762,20 +762,16 @@ bool AutofillAgent::IsUserGesture() const {
return WebUserGestureIndicator::isProcessingUserGesture();
}
-void AutofillAgent::didAssociateFormControls(const WebVector<WebNode>& nodes) {
- for (size_t i = 0; i < nodes.size(); ++i) {
- WebLocalFrame* frame = nodes[i].document().frame();
- // Only monitors dynamic forms created in the top frame. Dynamic forms
- // inserted in iframes are not captured yet. Frame is only processed
- // if it has finished loading, otherwise you can end up with a partially
- // parsed form.
- if (frame && !frame->isLoading()) {
- ProcessForms();
- password_autofill_agent_->OnDynamicFormsSeen();
- if (password_generation_agent_)
- password_generation_agent_->OnDynamicFormsSeen();
- return;
- }
+void AutofillAgent::didAssociateFormControlsDynamically() {
+ blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
+
+ // Frame is only processed if it has finished loading, otherwise you can end
+ // up with a partially parsed form.
+ if (frame && !frame->isLoading()) {
+ ProcessForms();
+ password_autofill_agent_->OnDynamicFormsSeen();
+ if (password_generation_agent_)
+ password_generation_agent_->OnDynamicFormsSeen();
}
}
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.h ('k') | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698