Commit b68013eb authored by Anne Lim's avatar Anne Lim Committed by Commit Bot

[Autofill] Butter + Cardholder name fix flow case

When Project Butter and the credit card upload cardholder name fix
flow are shown at the same time, their respective (i) help icons
are merged and tooltip messages get combined.

Bug: 958637
Change-Id: I3cad0dc45b6ee4b0f4e6b006a538a1ac09e926eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1595116Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Anne Lim <annelim@google.com>
Cr-Commit-Position: refs/heads/master@{#657585}
parent d856bd01
......@@ -66,9 +66,14 @@ views::View* SaveCardOfferBubbleViews::CreateExtraView() {
return nullptr;
}
// CreateMainContentView() must happen prior to this so that |prefilled_name|
// gets populated.
auto* upload_explanation_tooltip =
new views::TooltipIcon(l10n_util::GetStringUTF16(
IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION_TOOLTIP));
(cardholder_name_textfield_ &&
!cardholder_name_textfield_->text().empty())
? IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION_AND_CARDHOLDER_NAME_TOOLTIP
: IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION_TOOLTIP));
upload_explanation_tooltip->set_bubble_width(kTooltipBubbleWidth);
upload_explanation_tooltip->set_anchor_point_arrow(
views::BubbleBorder::Arrow::TOP_RIGHT);
......@@ -217,8 +222,12 @@ std::unique_ptr<views::View> SaveCardOfferBubbleViews::CreateMainContentView() {
}
// Set up cardholder name label tooltip ONLY if the cardholder name
// textfield will be prefilled.
if (!prefilled_name.empty()) {
// textfield will be prefilled and sync transport for Wallet data is not
// active. Otherwise, this tooltip's info will appear in CreateExtraView()'s
// tooltip.
if (!prefilled_name.empty() &&
controller()->GetSyncState() !=
AutofillSyncSigninState::kSignedInAndWalletSyncTransportEnabled) {
std::unique_ptr<views::TooltipIcon> cardholder_name_tooltip =
std::make_unique<views::TooltipIcon>(
l10n_util::GetStringUTF16(
......
......@@ -115,6 +115,9 @@
<message name="IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION_TOOLTIP" desc="The tooltip hover text that explains why credit card upload to Google Payments is being offered.">
Chrome is offering to save your cards in your Google Account because you are signed in. You can change this behavior in settings.
</message>
<message name="IDS_AUTOFILL_SAVE_CARD_PROMPT_UPLOAD_EXPLANATION_AND_CARDHOLDER_NAME_TOOLTIP" desc="The tooltip hover text that explains why credit card upload to Google Account is being offered and where the suggested cardholder name came from.">
Chrome is offering to save your cards in your Google Account because you are signed in. You can change this behavior in settings. The cardholder name comes from your account.
</message>
<!-- Autofill Local card migration bubble or dialog -->
<if expr="not is_ios and not is_android">
......
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