| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) { | 576 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) { |
| 577 AutofillMetrics::LogAddressSuggestionsCount(suggestions.size()); | 577 AutofillMetrics::LogAddressSuggestionsCount(suggestions.size()); |
| 578 has_logged_address_suggestions_count_ = true; | 578 has_logged_address_suggestions_count_ = true; |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 } | 581 } |
| 582 } | 582 } |
| 583 | 583 |
| 584 // If there are no Autofill suggestions, consider showing Autocomplete | 584 // If there are no Autofill suggestions, consider showing Autocomplete |
| 585 // suggestions. We will not show Autocomplete suggestions for a field that | 585 // suggestions. We will not show Autocomplete suggestions for a field that |
| 586 // specifies autocomplete=off or a field that we think is a credit card | 586 // specifies autocomplete=off (or an unrecognized type) or a field that we |
| 587 // expiration, cvc or number. | 587 // think is a credit card expiration, cvc or number. |
| 588 if (suggestions.empty() && field.should_autocomplete && | 588 if (suggestions.empty() && field.should_autocomplete && |
| 589 !(autofill_field && | 589 !(autofill_field && |
| 590 (IsCreditCardExpirationType(autofill_field->Type().GetStorableType()) || | 590 (IsCreditCardExpirationType(autofill_field->Type().GetStorableType()) || |
| 591 autofill_field->Type().html_type() == HTML_TYPE_UNRECOGNIZED || |
| 591 autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER || | 592 autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER || |
| 592 autofill_field->Type().GetStorableType() == | 593 autofill_field->Type().GetStorableType() == |
| 593 CREDIT_CARD_VERIFICATION_CODE))) { | 594 CREDIT_CARD_VERIFICATION_CODE))) { |
| 594 // Suggestions come back asynchronously, so the Autocomplete manager will | 595 // Suggestions come back asynchronously, so the Autocomplete manager will |
| 595 // handle sending the results back to the renderer. | 596 // handle sending the results back to the renderer. |
| 596 autocomplete_history_manager_->OnGetAutocompleteSuggestions( | 597 autocomplete_history_manager_->OnGetAutocompleteSuggestions( |
| 597 query_id, field.name, field.value, field.form_control_type); | 598 query_id, field.name, field.value, field.form_control_type); |
| 598 return; | 599 return; |
| 599 } | 600 } |
| 600 | 601 |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 if (i > 0) | 2042 if (i > 0) |
| 2042 fputs("Next oldest form:\n", file); | 2043 fputs("Next oldest form:\n", file); |
| 2043 } | 2044 } |
| 2044 fputs("\n", file); | 2045 fputs("\n", file); |
| 2045 | 2046 |
| 2046 fclose(file); | 2047 fclose(file); |
| 2047 } | 2048 } |
| 2048 #endif // ENABLE_FORM_DEBUG_DUMP | 2049 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2049 | 2050 |
| 2050 } // namespace autofill | 2051 } // namespace autofill |
| OLD | NEW |