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

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

Issue 12852003: Autofill:Autocheckout: Enable looking at all elements for Autocheckout flow (ignoring 3 element lim… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment in test file. 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/form_structure.cc
diff --git a/components/autofill/browser/form_structure.cc b/components/autofill/browser/form_structure.cc
index 8dbf6bd5304ba8b2684ea32c8988d41eb32f53ca..005415aea41ab532fb2653ca718d3711e2d40c82 100644
--- a/components/autofill/browser/form_structure.cc
+++ b/components/autofill/browser/form_structure.cc
@@ -609,12 +609,6 @@ void FormStructure::UpdateAutofillCount() {
}
bool FormStructure::ShouldBeParsed(bool require_method_post) const {
- // Ignore counting checkable elements towards minimum number of elements
- // required to parse. This avoids trying to crowdsource forms with few text
- // or select elements.
- if ((field_count() - checkable_field_count()) < RequiredFillableFields())
- return false;
-
// Rule out http(s)://*/search?...
// e.g. http://www.google.com/search?q=...
// http://search.yahoo.com/search?p=...
@@ -622,6 +616,12 @@ bool FormStructure::ShouldBeParsed(bool require_method_post) const {
return false;
if (!IsAutocheckoutEnabled()) {
+ // Ignore counting checkable elements towards minimum number of elements
+ // required to parse. This avoids trying to crowdsource forms with few text
+ // or select elements.
+ if ((field_count() - checkable_field_count()) < RequiredFillableFields())
+ return false;
+
// Make sure there is at least one text field when Autocheckout is
// not enabled.
bool has_text_field = false;
@@ -637,7 +637,9 @@ bool FormStructure::ShouldBeParsed(bool require_method_post) const {
}
bool FormStructure::ShouldBeCrowdsourced() const {
- return !has_author_specified_types_ && ShouldBeParsed(true);
+ // Allow all forms in Autocheckout flow to be crowdsourced.
+ return (!has_author_specified_types_ && ShouldBeParsed(true)) ||
+ IsAutocheckoutEnabled();
}
void FormStructure::UpdateFromCache(const FormStructure& cached_form) {

Powered by Google App Engine
This is Rietveld 408576698