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

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

Issue 802613004: Autofill - Improve preview of masked Wallet cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 8cfc8b2505d29f4552dc5eae22d2ee57cfaefb7c..5094772be2f74cdfa81c3fb5ebdc849cd423dcb0 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -406,8 +406,14 @@ void CreditCard::SetRawInfo(ServerFieldType type,
base::string16 CreditCard::GetInfo(const AutofillType& type,
const std::string& app_locale) const {
ServerFieldType storable_type = type.GetStorableType();
- if (storable_type == CREDIT_CARD_NUMBER)
+ if (storable_type == CREDIT_CARD_NUMBER) {
+ // Web pages should never actually be filled by a masked server card,
+ // but this function is used at the preview stage.
+ if (record_type() == MASKED_SERVER_CARD)
+ return TypeAndLastFourDigits();
+
return StripSeparators(number_);
+ }
return GetRawInfo(storable_type);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698