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

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

Issue 2913223002: Make payment instrument labels dynamic (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 dad051d22328a9a7a626809646f701317fa47318..75c44845c1de1c5570b40ec9543b303038b29e5d 100644
--- a/components/payments/core/autofill_payment_instrument.cc
+++ b/components/payments/core/autofill_payment_instrument.cc
@@ -30,10 +30,6 @@ AutofillPaymentInstrument::AutofillPaymentInstrument(
PaymentRequestDelegate* payment_request_delegate)
: PaymentInstrument(
method_name,
- /* label= */ card.NetworkAndLastFourDigits(),
- /* sublabel= */
- card.GetInfo(autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL),
- app_locale),
autofill::data_util::GetPaymentRequestData(card.network())
.icon_resource_id,
PaymentInstrument::Type::AUTOFILL),
@@ -109,6 +105,15 @@ void AutofillPaymentInstrument::RecordUse() {
credit_card_);
}
+base::string16 AutofillPaymentInstrument::GetLabel() const {
+ return credit_card_.NetworkAndLastFourDigits();
+}
+
+base::string16 AutofillPaymentInstrument::GetSublabel() const {
+ return credit_card_.GetInfo(
+ autofill::AutofillType(autofill::CREDIT_CARD_NAME_FULL), app_locale_);
+}
+
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