Chromium Code Reviews| 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 f06b605f747b43396946ba3dabb5e3505202768a..a90e4b916df3c4530a43d9c3ce68b8dda41b30c8 100644 |
| --- a/components/autofill/core/browser/autofill_manager.cc |
| +++ b/components/autofill/core/browser/autofill_manager.cc |
| @@ -272,6 +272,20 @@ bool AutofillManager::ShouldShowScanCreditCard(const FormData& form, |
| base::ASCIIToUTF16("0123456789")); |
| } |
| +bool AutofillManager::ShouldShowCreditCardSigninPromo( |
| + const FormData& form, |
| + const FormFieldData& field) { |
| + // Check whether we are dealing with a credit card field. |
| + AutofillField* autofill_field = GetAutofillField(form, field); |
| + if (!autofill_field || autofill_field->Type().group() != CREDIT_CARD) { |
|
Evan Stade
2016/07/08 17:34:58
nit: return autofill_field && autofill_field->Type
Mathieu
2016/07/08 18:10:02
Neater thanks
|
| + return false; |
| + } |
| + |
| + // Will check if the user is signed in and if it's appropriate to show the |
| + // promo (e.g. the platform is supported). |
| + return client_->ShouldShowSigninPromo(); |
| +} |
| + |
| void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, |
| const TimeTicks& timestamp) { |
| if (!IsValidFormDataVector(forms)) |