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

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2124343002: [Autofill] Implement Credit Card Signin Promo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
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..e43e85b26d8268c3f1c56f4bc09cb35c5e81517b 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -272,6 +272,16 @@ 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 and whether it's
+ // appropriate to show the promo (e.g. the platform is supported).
+ AutofillField* autofill_field = GetAutofillField(form, field);
+ return autofill_field && autofill_field->Type().group() == CREDIT_CARD &&
+ client_->ShouldShowSigninPromo();
+}
+
void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms,
const TimeTicks& timestamp) {
if (!IsValidFormDataVector(forms))
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698