Commit d60acebd authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

PaymentRequest should not reference Google Payments when unmasking cards stored on device

Previous CL affected both Chrome Downstream card unmasking *and* PaymentRequest:
https://chromium-review.googlesource.com/c/chromium/src/+/780361

Bug: 
Change-Id: I60fb111109f2c1ee0406158d0558cad4d3a17a95
Reviewed-on: https://chromium-review.googlesource.com/785793Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Commit-Queue: Mathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519886}
parent cb719009
......@@ -159,8 +159,13 @@ void CvcUnmaskViewController::FillContentView(views::View* content_view) {
views::GridLayout::SizeType::USE_PREF, 0, 0);
layout->StartRow(0, 0);
std::unique_ptr<views::Label> instructions = base::MakeUnique<views::Label>(
l10n_util::GetStringUTF16(IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS));
// The prompt for server cards should reference Google Payments, whereas the
// prompt for local cards should not.
std::unique_ptr<views::Label> instructions =
base::MakeUnique<views::Label>(l10n_util::GetStringUTF16(
credit_card_.record_type() == autofill::CreditCard::LOCAL_CARD
? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_LOCAL_CARD
: IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS));
instructions->SetMultiLine(true);
instructions->SetHorizontalAlignment(gfx::ALIGN_LEFT);
layout->AddView(instructions.release());
......
......@@ -229,13 +229,19 @@ base::string16 CardUnmaskPromptControllerImpl::GetWindowTitle() const {
}
base::string16 CardUnmaskPromptControllerImpl::GetInstructionsMessage() const {
// The prompt for server cards should reference Google Payments, whereas the
// prompt for local cards should not.
#if defined(OS_IOS)
int ids;
if (reason_ == AutofillClient::UNMASK_FOR_AUTOFILL &&
ShouldRequestExpirationDate()) {
ids = IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED;
ids = card_.record_type() == autofill::CreditCard::LOCAL_CARD
? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED_LOCAL_CARD
: IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED;
} else {
ids = IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS;
ids = card_.record_type() == autofill::CreditCard::LOCAL_CARD
? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_LOCAL_CARD
: IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS;
}
// The iOS UI shows the card details in the instructions text since they
// don't fit in the title.
......@@ -243,7 +249,9 @@ base::string16 CardUnmaskPromptControllerImpl::GetInstructionsMessage() const {
card_.NetworkOrBankNameAndLastFourDigits());
#else
return l10n_util::GetStringUTF16(
IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS);
card_.record_type() == autofill::CreditCard::LOCAL_CARD
? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_LOCAL_CARD
: IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS);
#endif
}
......
......@@ -325,6 +325,9 @@
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS" desc="Text explaining what the user should do in the card unmasking dialog.">
After you confirm, card details from your Google Payments account will be shared with this site.
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_LOCAL_CARD" desc="Text explaining what the user should do in the card unmasking dialog. Appears specifically for local cards already stored on the device.">
Once you confirm, your card details will be shared with this site.
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_CVC_IMAGE_DESCRIPTION" desc="Accessible description for the CVC image. It should describe where to find the CVC on a credit card.">
The CVC is located behind your card.
</message>
......@@ -336,9 +339,15 @@
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS" desc="Text explaining what the user should do in the card unmasking dialog.">
Enter the CVC for <ph name="CREDIT_CARD">$1<ex>Visa - 5679</ex></ph>. After you confirm, card details from your Google Payments account will be shared with this site.
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_LOCAL_CARD" desc="Text explaining what the user should do in the card unmasking dialog. Appears specifically for local cards already stored on the device.">
Enter the CVC for <ph name="CREDIT_CARD">$1<ex>Visa - 5679</ex></ph>. Once you confirm, your card details will be shared with this site.
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED" desc="Text explaining what the user should do in the card unmasking dialog to update an expired card.">
Enter the expiration date and CVC for <ph name="CREDIT_CARD">$1<ex>Visa - 5679</ex></ph> to update your card details. After you confirm, card details from your Google Payments account will be shared with this site.
</message>
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED_LOCAL_CARD" desc="Text explaining what the user should do in the card unmasking dialog to update an expired card. Appears specifically for local cards already stored on the device.">
Enter the expiration date and CVC for <ph name="CREDIT_CARD">$1<ex>Visa - 5679</ex></ph> to update your card details. Once you confirm, your card details will be shared with this site.
</message>
</if>
<message name="IDS_AUTOFILL_CARD_UNMASK_PROMPT_STORAGE_CHECKBOX" desc="Text for checkbox in card unmasking dialog that allows user to store a Wallet card on their local device. If checked, the dialog won't show up again for the given credit card." formatter_data="android_java">
Keep a copy of this card on this device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment