| Index: components/autofill/core/browser/autofill_manager.cc
|
| diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
|
| index 962dffd1b951aebba3c0f90a9fca1b8c96cdfba5..c512811e606badc11551563fc068a4316fe98b7c 100644
|
| --- a/components/autofill/core/browser/autofill_manager.cc
|
| +++ b/components/autofill/core/browser/autofill_manager.cc
|
| @@ -44,6 +44,7 @@
|
| #include "components/autofill/core/browser/phone_number.h"
|
| #include "components/autofill/core/browser/phone_number_i18n.h"
|
| #include "components/autofill/core/browser/popup_item_ids.h"
|
| +#include "components/autofill/core/common/autofill_constants.h"
|
| #include "components/autofill/core/common/autofill_data_validation.h"
|
| #include "components/autofill/core/common/autofill_pref_names.h"
|
| #include "components/autofill/core/common/autofill_switches.h"
|
| @@ -389,8 +390,8 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
|
| AutofillField* autofill_field = NULL;
|
| bool got_autofillable_form =
|
| GetCachedFormAndField(form, field, &form_structure, &autofill_field) &&
|
| - // Don't send suggestions or track forms that aren't auto-fillable.
|
| - form_structure->IsAutofillable();
|
| + // Don't send suggestions or track forms that should not be parsed.
|
| + form_structure->ShouldBeParsed();
|
|
|
| // Logging interactions of forms that are autofillable.
|
| if (got_autofillable_form) {
|
| @@ -886,17 +887,9 @@ bool AutofillManager::IsCreditCardUploadEnabled() {
|
| }
|
|
|
| bool AutofillManager::ShouldUploadForm(const FormStructure& form) {
|
| - if (!IsAutofillEnabled())
|
| - return false;
|
| -
|
| - if (driver_->IsOffTheRecord())
|
| - return false;
|
| -
|
| - // Disregard forms that we wouldn't ever autofill in the first place.
|
| - if (!form.ShouldBeParsed())
|
| - return false;
|
| -
|
| - return true;
|
| + return IsAutofillEnabled() && !driver_->IsOffTheRecord() &&
|
| + form.ShouldBeParsed() &&
|
| + form.active_field_count() >= kRequiredFieldsForUpload;
|
| }
|
|
|
| void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
|
| @@ -1494,6 +1487,7 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) {
|
| std::vector<FormStructure*> queryable_forms;
|
| for (const FormData& form : forms) {
|
| scoped_ptr<FormStructure> form_structure(new FormStructure(form));
|
| + form_structure->ParseFieldTypesFromAutocompleteAttributes();
|
|
|
| if (!form_structure->ShouldBeParsed())
|
| continue;
|
|
|