OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 | 936 |
937 bool AutofillManager::IsCreditCardUploadEnabled() { | 937 bool AutofillManager::IsCreditCardUploadEnabled() { |
938 return ::autofill::IsCreditCardUploadEnabled( | 938 return ::autofill::IsCreditCardUploadEnabled( |
939 client_->GetPrefs(), client_->GetSyncService(), | 939 client_->GetPrefs(), client_->GetSyncService(), |
940 GetIdentityProvider()->GetActiveUsername()); | 940 GetIdentityProvider()->GetActiveUsername()); |
941 } | 941 } |
942 | 942 |
943 bool AutofillManager::ShouldUploadForm(const FormStructure& form) { | 943 bool AutofillManager::ShouldUploadForm(const FormStructure& form) { |
944 return IsAutofillEnabled() && !driver_->IsOffTheRecord() && | 944 return IsAutofillEnabled() && !driver_->IsOffTheRecord() && |
945 form.ShouldBeParsed() && | 945 form.ShouldBeParsed() && |
946 form.active_field_count() >= kRequiredFieldsForUpload; | 946 (form.active_field_count() >= kRequiredFieldsForUpload || |
| 947 (form.all_fields_are_passwords() && |
| 948 form.active_field_count() >= |
| 949 kRequiredFieldsForFormsWithOnlyPasswordFields)); |
947 } | 950 } |
948 | 951 |
949 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { | 952 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { |
950 scoped_ptr<CreditCard> imported_credit_card; | 953 scoped_ptr<CreditCard> imported_credit_card; |
951 if (!personal_data_->ImportFormData( | 954 if (!personal_data_->ImportFormData( |
952 submitted_form, IsCreditCardUploadEnabled(), &imported_credit_card)) { | 955 submitted_form, IsCreditCardUploadEnabled(), &imported_credit_card)) { |
953 return; | 956 return; |
954 } | 957 } |
955 | 958 |
956 #ifdef ENABLE_FORM_DEBUG_DUMP | 959 #ifdef ENABLE_FORM_DEBUG_DUMP |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 if (i > 0) | 1777 if (i > 0) |
1775 fputs("Next oldest form:\n", file); | 1778 fputs("Next oldest form:\n", file); |
1776 } | 1779 } |
1777 fputs("\n", file); | 1780 fputs("\n", file); |
1778 | 1781 |
1779 fclose(file); | 1782 fclose(file); |
1780 } | 1783 } |
1781 #endif // ENABLE_FORM_DEBUG_DUMP | 1784 #endif // ENABLE_FORM_DEBUG_DUMP |
1782 | 1785 |
1783 } // namespace autofill | 1786 } // namespace autofill |
OLD | NEW |