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

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: ifdef 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..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))

Powered by Google App Engine
This is Rietveld 408576698