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

Unified Diff: chrome/renderer/autofill/autofill_agent.cc

Issue 7978048: Don't ask the browser for Autofill suggestions for non-autofillable form fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 9 years, 3 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
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/renderer/autofill/autofill_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill/autofill_agent.cc
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
index 9335f3c4f63632f9b94996efe1015680c75ee862..456af20c841876ec4869464ccfae5f0ffa0321c7 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -222,7 +222,7 @@ void AutofillAgent::TextFieldDidChangeImpl(const WebInputElement& element) {
webkit_glue::FormData form;
webkit_glue::FormField field;
- if (FindFormAndFieldForNode(element, &form, &field)) {
+ if (FindFormAndFieldForInputElement(element, &form, &field, REQUIRE_NONE)) {
Send(new AutofillHostMsg_TextFieldDidChange(routing_id(), form, field,
base::TimeTicks::Now()));
}
@@ -399,7 +399,8 @@ void AutofillAgent::QueryAutofillSuggestions(const WebInputElement& element,
webkit_glue::FormData form;
webkit_glue::FormField field;
- if (!FindFormAndFieldForNode(element, &form, &field)) {
+ if (!FindFormAndFieldForInputElement(element, &form, &field,
+ REQUIRE_AUTOCOMPLETE)) {
// If we didn't find the cached form, at least let autocomplete have a shot
// at providing suggestions.
WebFormControlElementToFormField(element, EXTRACT_VALUE, &field);
@@ -417,8 +418,10 @@ void AutofillAgent::FillAutofillFormData(const WebNode& node,
webkit_glue::FormData form;
webkit_glue::FormField field;
- if (!FindFormAndFieldForNode(node, &form, &field))
+ if (!FindFormAndFieldForInputElement(node.toConst<WebInputElement>(), &form,
+ &field, REQUIRE_AUTOCOMPLETE)) {
return;
+ }
autofill_action_ = action;
was_query_node_autofilled_ = field.is_autofilled;
@@ -426,11 +429,4 @@ void AutofillAgent::FillAutofillFormData(const WebNode& node,
routing_id(), autofill_query_id_, form, field, unique_id));
}
-bool AutofillAgent::FindFormAndFieldForNode(const WebNode& node,
- webkit_glue::FormData* form,
- webkit_glue::FormField* field) {
- const WebInputElement& element = node.toConst<WebInputElement>();
- return FindFormAndFieldForFormControlElement(element, form, field);
-}
-
} // namespace autofill
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | chrome/renderer/autofill/autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698