Commit 71c2a39c authored by siyua's avatar siyua Committed by Commit Bot

[AF][Upstream String] Add separate "No thanks" button label for autofill payments UI

Add a No thanks used only by Payments Autofill. So when we want to override strings
with Finch overrides no other usages will be affected.

Bug: 961082
Change-Id: I85519146a5b4b3b88c65065e2378aba15c6e6971
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610308Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664855}
parent 19444b5a
...@@ -330,11 +330,13 @@ base::string16 SaveCardBubbleControllerImpl::GetExplanatoryMessage() const { ...@@ -330,11 +330,13 @@ base::string16 SaveCardBubbleControllerImpl::GetExplanatoryMessage() const {
base::string16 SaveCardBubbleControllerImpl::GetAcceptButtonText() const { base::string16 SaveCardBubbleControllerImpl::GetAcceptButtonText() const {
switch (current_bubble_type_) { switch (current_bubble_type_) {
case BubbleType::LOCAL_SAVE: case BubbleType::LOCAL_SAVE:
return l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT); return l10n_util::GetStringUTF16(
IDS_AUTOFILL_SAVE_CARD_BUBBLE_LOCAL_SAVE_ACCEPT);
case BubbleType::UPLOAD_SAVE: { case BubbleType::UPLOAD_SAVE: {
if (!base::FeatureList::IsEnabled( if (!base::FeatureList::IsEnabled(
features::kAutofillSaveCardImprovedUserConsent)) { features::kAutofillSaveCardImprovedUserConsent)) {
return l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT); return l10n_util::GetStringUTF16(
IDS_AUTOFILL_SAVE_CARD_BUBBLE_UPLOAD_SAVE_ACCEPT);
} }
std::string param = base::GetFieldTrialParamValueByFeature( std::string param = base::GetFieldTrialParamValueByFeature(
features::kAutofillSaveCreditCardUsesImprovedMessaging, features::kAutofillSaveCreditCardUsesImprovedMessaging,
...@@ -360,7 +362,8 @@ base::string16 SaveCardBubbleControllerImpl::GetAcceptButtonText() const { ...@@ -360,7 +362,8 @@ base::string16 SaveCardBubbleControllerImpl::GetAcceptButtonText() const {
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT_COPY_TEST_CONFIRM_AND_SAVE); IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT_COPY_TEST_CONFIRM_AND_SAVE);
} }
return l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT); return l10n_util::GetStringUTF16(
IDS_AUTOFILL_SAVE_CARD_BUBBLE_UPLOAD_SAVE_ACCEPT);
} }
case BubbleType::MANAGE_CARDS: case BubbleType::MANAGE_CARDS:
return l10n_util::GetStringUTF16(IDS_AUTOFILL_DONE); return l10n_util::GetStringUTF16(IDS_AUTOFILL_DONE);
...@@ -375,7 +378,8 @@ base::string16 SaveCardBubbleControllerImpl::GetAcceptButtonText() const { ...@@ -375,7 +378,8 @@ base::string16 SaveCardBubbleControllerImpl::GetAcceptButtonText() const {
base::string16 SaveCardBubbleControllerImpl::GetDeclineButtonText() const { base::string16 SaveCardBubbleControllerImpl::GetDeclineButtonText() const {
switch (current_bubble_type_) { switch (current_bubble_type_) {
case BubbleType::LOCAL_SAVE: case BubbleType::LOCAL_SAVE:
return l10n_util::GetStringUTF16(IDS_NO_THANKS); return l10n_util::GetStringUTF16(
IDS_AUTOFILL_NO_THANKS_DESKTOP_LOCAL_SAVE);
case BubbleType::UPLOAD_SAVE: { case BubbleType::UPLOAD_SAVE: {
// There is no decline button when experiment is off. // There is no decline button when experiment is off.
DCHECK(base::FeatureList::IsEnabled( DCHECK(base::FeatureList::IsEnabled(
...@@ -398,7 +402,8 @@ base::string16 SaveCardBubbleControllerImpl::GetDeclineButtonText() const { ...@@ -398,7 +402,8 @@ base::string16 SaveCardBubbleControllerImpl::GetDeclineButtonText() const {
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
IDS_AUTOFILL_SAVE_CARD_PROMPT_DECLINE_COPY_TEST_ADD); IDS_AUTOFILL_SAVE_CARD_PROMPT_DECLINE_COPY_TEST_ADD);
} }
return l10n_util::GetStringUTF16(IDS_NO_THANKS); return l10n_util::GetStringUTF16(
IDS_AUTOFILL_NO_THANKS_DESKTOP_UPLOAD_SAVE);
} }
case BubbleType::MANAGE_CARDS: case BubbleType::MANAGE_CARDS:
case BubbleType::SIGN_IN_PROMO: case BubbleType::SIGN_IN_PROMO:
......
...@@ -88,10 +88,9 @@ int LocalCardMigrationBubbleViews::GetDialogButtons() const { ...@@ -88,10 +88,9 @@ int LocalCardMigrationBubbleViews::GetDialogButtons() const {
base::string16 LocalCardMigrationBubbleViews::GetDialogButtonLabel( base::string16 LocalCardMigrationBubbleViews::GetDialogButtonLabel(
ui::DialogButton button) const { ui::DialogButton button) const {
DCHECK_EQ(button, ui::DIALOG_BUTTON_OK);
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
button == ui::DIALOG_BUTTON_OK IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BUTTON_LABEL);
? IDS_AUTOFILL_LOCAL_CARD_MIGRATION_BUBBLE_BUTTON_LABEL
: IDS_NO_THANKS);
} }
gfx::Size LocalCardMigrationBubbleViews::CalculatePreferredSize() const { gfx::Size LocalCardMigrationBubbleViews::CalculatePreferredSize() const {
......
...@@ -82,7 +82,7 @@ base::string16 AutofillCreditCardFillingInfoBarDelegateMobile::GetButtonLabel( ...@@ -82,7 +82,7 @@ base::string16 AutofillCreditCardFillingInfoBarDelegateMobile::GetButtonLabel(
InfoBarButton button) const { InfoBarButton button) const {
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
button == BUTTON_OK ? IDS_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_ACCEPT button == BUTTON_OK ? IDS_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_ACCEPT
: IDS_NO_THANKS); : IDS_AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_NO_THANKS);
} }
void AutofillCreditCardFillingInfoBarDelegateMobile::LogUserAction( void AutofillCreditCardFillingInfoBarDelegateMobile::LogUserAction(
......
...@@ -161,7 +161,7 @@ base::string16 AutofillSaveCardInfoBarDelegateMobile::GetButtonLabel( ...@@ -161,7 +161,7 @@ base::string16 AutofillSaveCardInfoBarDelegateMobile::GetButtonLabel(
return options_.should_request_name_from_user || return options_.should_request_name_from_user ||
options_.should_request_expiration_date_from_user options_.should_request_expiration_date_from_user
? l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_CONTINUE) ? l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_CONTINUE)
: l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT); : l10n_util::GetStringUTF16(IDS_AUTOFILL_SAVE_CARD_INFOBAR_ACCEPT);
} }
bool AutofillSaveCardInfoBarDelegateMobile::Accept() { bool AutofillSaveCardInfoBarDelegateMobile::Accept() {
......
...@@ -68,10 +68,6 @@ ...@@ -68,10 +68,6 @@
</if> </if>
<!-- Autofill save credit card bubble or infobar prompt --> <!-- Autofill save credit card bubble or infobar prompt -->
<!--TODO(crbug.com/961082): Remove this once the separate label is in use. -->
<message name="IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT" desc="Text to show for the Autofill save credit card prompt accept button. The prompt can be either a bubble or an infobar.">
Save
</message>
<if expr="is_android or is_ios"> <if expr="is_android or is_ios">
<then> <then>
<message name="IDS_AUTOFILL_SAVE_CARD_INFOBAR_ACCEPT" desc="Text to show for the Autofill save credit card infobar accept button."> <message name="IDS_AUTOFILL_SAVE_CARD_INFOBAR_ACCEPT" desc="Text to show for the Autofill save credit card infobar accept button.">
......
...@@ -78,7 +78,7 @@ id<GREYMatcher> closeButtonMatcher() { ...@@ -78,7 +78,7 @@ id<GREYMatcher> closeButtonMatcher() {
id<GREYMatcher> saveButtonMatcher() { id<GREYMatcher> saveButtonMatcher() {
return chrome_test_util::ButtonWithAccessibilityLabelId( return chrome_test_util::ButtonWithAccessibilityLabelId(
IDS_AUTOFILL_SAVE_CARD_PROMPT_ACCEPT); IDS_AUTOFILL_SAVE_CARD_INFOBAR_ACCEPT);
} }
} // namepsace } // namepsace
......
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