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

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2478013004: [Merge M55] [Autofill] Credit card signin promo: do not require a local suggestion (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) { 594 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) {
595 AutofillMetrics::LogAddressSuggestionsCount(suggestions.size()); 595 AutofillMetrics::LogAddressSuggestionsCount(suggestions.size());
596 has_logged_address_suggestions_count_ = true; 596 has_logged_address_suggestions_count_ = true;
597 } 597 }
598 } 598 }
599 } 599 }
600 } 600 }
601 601
602 // If there are no Autofill suggestions, consider showing Autocomplete 602 // If there are no Autofill suggestions, consider showing Autocomplete
603 // suggestions. We will not show Autocomplete suggestions for a field that 603 // suggestions. We will not show Autocomplete suggestions for a field that
604 // specifies autocomplete=off (or an unrecognized type) or a field that we 604 // specifies autocomplete=off (or an unrecognized type), a field for which we
605 // think is a credit card expiration, cvc or number. 605 // will show the credit card signin promo, or a field that we think is a
606 if (suggestions.empty() && field.should_autocomplete && 606 // credit card expiration, cvc or number.
607 if (suggestions.empty() && !ShouldShowCreditCardSigninPromo(form, field) &&
608 field.should_autocomplete &&
607 !(autofill_field && 609 !(autofill_field &&
608 (IsCreditCardExpirationType(autofill_field->Type().GetStorableType()) || 610 (IsCreditCardExpirationType(autofill_field->Type().GetStorableType()) ||
609 autofill_field->Type().html_type() == HTML_TYPE_UNRECOGNIZED || 611 autofill_field->Type().html_type() == HTML_TYPE_UNRECOGNIZED ||
610 autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER || 612 autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER ||
611 autofill_field->Type().GetStorableType() == 613 autofill_field->Type().GetStorableType() ==
612 CREDIT_CARD_VERIFICATION_CODE))) { 614 CREDIT_CARD_VERIFICATION_CODE))) {
613 // Suggestions come back asynchronously, so the Autocomplete manager will 615 // Suggestions come back asynchronously, so the Autocomplete manager will
614 // handle sending the results back to the renderer. 616 // handle sending the results back to the renderer.
615 autocomplete_history_manager_->OnGetAutocompleteSuggestions( 617 autocomplete_history_manager_->OnGetAutocompleteSuggestions(
616 query_id, field.name, field.value, field.form_control_type); 618 query_id, field.name, field.value, field.form_control_type);
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2081 if (i > 0) 2083 if (i > 0)
2082 fputs("Next oldest form:\n", file); 2084 fputs("Next oldest form:\n", file);
2083 } 2085 }
2084 fputs("\n", file); 2086 fputs("\n", file);
2085 2087
2086 fclose(file); 2088 fclose(file);
2087 } 2089 }
2088 #endif // ENABLE_FORM_DEBUG_DUMP 2090 #endif // ENABLE_FORM_DEBUG_DUMP
2089 2091
2090 } // namespace autofill 2092 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698