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

Unified Diff: components/payments/core/autofill_payment_instrument.cc

Issue 2874873002: [Payments] Record use stats after payment request completion. (Closed)
Patch Set: Created 3 years, 7 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/payments/core/autofill_payment_instrument.cc
diff --git a/components/payments/core/autofill_payment_instrument.cc b/components/payments/core/autofill_payment_instrument.cc
index 08502b4e832477bd4c4697e276240ca7fa536ee9..053ba4298f3b1438e033ca6c5d5230204d2043f2 100644
--- a/components/payments/core/autofill_payment_instrument.cc
+++ b/components/payments/core/autofill_payment_instrument.cc
@@ -103,6 +103,18 @@ bool AutofillPaymentInstrument::IsValidForCanMakePayment() {
status & autofill::CREDIT_CARD_NO_NUMBER);
}
+void AutofillPaymentInstrument::RecordUse() {
+ // Record the use of the credit card.
+ payment_request_delegate_->GetPersonalDataManager()->RecordUseOf(
+ credit_card_);
+
+ // Record the use of the billing address.
Mathieu 2017/05/11 01:25:27 Yeah I'm not sure about that one, because we use a
sebsg 2017/05/11 17:49:18 Done.
+ DCHECK(credit_card_.billing_address_id() != "");
+ payment_request_delegate_->GetPersonalDataManager()->RecordUseOf(
+ *(payment_request_delegate_->GetPersonalDataManager()->GetProfileByGUID(
+ credit_card_.billing_address_id())));
+}
+
void AutofillPaymentInstrument::OnFullCardRequestSucceeded(
const autofill::CreditCard& card,
const base::string16& cvc) {
« no previous file with comments | « components/payments/core/autofill_payment_instrument.h ('k') | components/payments/core/payment_instrument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698