Commit 4e007992 authored by Caitlin Fischer's avatar Caitlin Fischer Committed by Commit Bot

[AF] Make Android label in keyboard accessory consistent with iOS.

This applies to labels for credit card suggestions when the credit card
number appears in the label.

On Android (dropdown and keyboard accessory), a suggestion appears as

dropdown:
Caitlin Fischer
Visa  ••••1234

keyboard accessory:
Caitlin Fischer  Visa  ••••1234

After this CL is merged, Android keyboard accessory labels will be
shown as Caitlin Fischer  ••••1234. Note that the network or bank name
is removed.

Bug: 968267
Change-Id: Ida9b745a82e98ca164b47fd444858e9f0643bb70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1670309
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671755}
parent cf10414c
...@@ -2105,10 +2105,14 @@ std::vector<Suggestion> PersonalDataManager::GetSuggestionsForCards( ...@@ -2105,10 +2105,14 @@ std::vector<Suggestion> PersonalDataManager::GetSuggestionsForCards(
} }
} else { } else {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// E.g. "Visa ••••1234". // On Android devices, the label is formatted as "Visa ••••1234" when
suggestion->label = credit_card->NetworkOrBankNameAndLastFourDigits(); // the keyboard accessory experiment is disabled and as "••••1234" when
// it's enabled.
suggestion->label =
base::FeatureList::IsEnabled(features::kAutofillKeyboardAccessory)
? credit_card->ObfuscatedLastFourDigits()
: credit_card->NetworkOrBankNameAndLastFourDigits();
#elif defined(OS_IOS) #elif defined(OS_IOS)
// TODO(crbug.com/968267): Use the same format for iOS and Android.
// E.g. "••••1234"". // E.g. "••••1234"".
suggestion->label = credit_card->ObfuscatedLastFourDigits(); suggestion->label = credit_card->ObfuscatedLastFourDigits();
#else #else
......
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