Commit 55282f99 authored by Krishna Govind's avatar Krishna Govind Committed by Commit Bot

Revert "[Autofill Offer] Update offer text to "cashback""

This reverts commit 7ba7ed5e.

Reason for revert:  Breaks translation, crbug.com/1135333

Original change's description:
> [Autofill Offer] Update offer text to "cashback"
>
> Bug: 1112095
> Change-Id: I614ec70d4ba183850cd19412c963bd344b7c318c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444800
> Commit-Queue: Siyu An <siyua@chromium.org>
> Reviewed-by: Jared Saul <jsaul@google.com>
> Cr-Commit-Position: refs/heads/master@{#813422}

TBR=jsaul@google.com,siyua@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1112095
Change-Id: I998f30b7c76cca3e933a64168bbc796248946a40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2451378Reviewed-by: default avatarKrishna Govind <govind@chromium.org>
Commit-Queue: Krishna Govind <govind@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814000}
parent 243dbcb1
...@@ -62,9 +62,14 @@ void AutofillOfferManager::UpdateSuggestionsWithOffers( ...@@ -62,9 +62,14 @@ void AutofillOfferManager::UpdateSuggestionsWithOffers(
for (auto& suggestion : suggestions) { for (auto& suggestion : suggestions) {
std::string id = suggestion.backend_id; std::string id = suggestion.backend_id;
if (eligible_offers_map.count(id)) { if (eligible_offers_map.count(id)) {
suggestion.offer_label = l10n_util::GetStringFUTF16( base::string16 reward_amount =
IDS_AUTOFILL_OFFERS_CASHBACK, base::UTF8ToUTF16(eligible_offers_map[id]->offer_reward_amount);
base::UTF8ToUTF16(eligible_offers_map[id]->offer_reward_amount));
auto string_id = (reward_amount.find('%') == std::string::npos)
? IDS_AUTOFILL_OFFERS_DISCOUNT
: IDS_AUTOFILL_OFFERS_CASHBACK;
suggestion.offer_label =
l10n_util::GetStringFUTF16(string_id, reward_amount);
} }
} }
} }
......
...@@ -96,7 +96,7 @@ TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_EligibleDiscount) { ...@@ -96,7 +96,7 @@ TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_EligibleDiscount) {
autofill_offer_manager_->UpdateSuggestionsWithOffers(GURL(kTestUrlWithParam), autofill_offer_manager_->UpdateSuggestionsWithOffers(GURL(kTestUrlWithParam),
suggestions); suggestions);
EXPECT_EQ(suggestions[0].offer_label, base::UTF8ToUTF16("$4 cashback")); EXPECT_EQ(suggestions[0].offer_label, base::UTF8ToUTF16("$4 Off"));
} }
TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_EligibleCashback) { TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_EligibleCashback) {
...@@ -108,7 +108,7 @@ TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_EligibleCashback) { ...@@ -108,7 +108,7 @@ TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_EligibleCashback) {
autofill_offer_manager_->UpdateSuggestionsWithOffers(GURL(kTestUrlWithParam), autofill_offer_manager_->UpdateSuggestionsWithOffers(GURL(kTestUrlWithParam),
suggestions); suggestions);
EXPECT_EQ(suggestions[0].offer_label, base::UTF8ToUTF16("5% cashback")); EXPECT_EQ(suggestions[0].offer_label, base::UTF8ToUTF16("5% Cash Back"));
} }
TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_ExpiredOffer) { TEST_F(AutofillOfferManagerTest, UpdateSuggestionsWithOffers_ExpiredOffer) {
......
...@@ -507,6 +507,10 @@ ...@@ -507,6 +507,10 @@
<!-- Credit card offers and rewards related strings --> <!-- Credit card offers and rewards related strings -->
<message name="IDS_AUTOFILL_OFFERS_CASHBACK" desc="Displays that a cashback offer will be rewarded if credit card is used on current page. Part of Autofill suggestions popup."> <message name="IDS_AUTOFILL_OFFERS_CASHBACK" desc="Displays that a cashback offer will be rewarded if credit card is used on current page. Part of Autofill suggestions popup.">
<ph name="REWARD_VALUE">$1<ex>5%</ex></ph> cashback <ph name="PERCENT">$1<ex>5%</ex></ph> Cash Back
</message> </message>
<message name="IDS_AUTOFILL_OFFERS_DISCOUNT" desc="Displays a discount that will be rewarded if credit card is used on current page. Part of Autofill suggestions popup.">
<ph name="DISCOUNT">$1<ex>$$3</ex></ph> Off
</message>
</grit-part> </grit-part>
c4d8bc532aa3a5146c9d639d56c364ddb1a3db14 378244426ac8f525d17518614e3d7b1508061cf9
\ No newline at end of file \ No newline at end of file
a09ae4c895b292cf8ce625cf9843a477d86dfc35
\ No newline at end of file
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