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); |
} |