| Index: components/autofill/core/browser/autofill_manager.cc
|
| diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
|
| index 5df3ca14bda7fa0fee2dde5a92456f091613c803..f5040f9fabc2f4ae3921ce65eb525f02fd9fbbe8 100644
|
| --- a/components/autofill/core/browser/autofill_manager.cc
|
| +++ b/components/autofill/core/browser/autofill_manager.cc
|
| @@ -700,6 +700,62 @@ void AutofillManager::OnHidePopup() {
|
| client_->HideAutofillPopup();
|
| }
|
|
|
| +bool AutofillManager::GetDeletionConfirmationText(const base::string16& value,
|
| + int identifier,
|
| + base::string16* title,
|
| + base::string16* body) {
|
| + if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
|
| + if (title)
|
| + title->assign(value);
|
| + if (body) {
|
| + body->assign(l10n_util::GetStringUTF16(
|
| + IDS_AUTOFILL_DELETE_AUTOCOMPLETE_SUGGESTION_CONFIRMATION_BODY));
|
| + }
|
| +
|
| + return true;
|
| + }
|
| +
|
| + if (identifier < 0)
|
| + return false;
|
| +
|
| + size_t variant = 0;
|
| + const CreditCard* credit_card = nullptr;
|
| + const AutofillProfile* profile = nullptr;
|
| + if (GetCreditCard(identifier, &credit_card)) {
|
| + if (credit_card->record_type() != CreditCard::LOCAL_CARD)
|
| + return false;
|
| +
|
| + if (title)
|
| + title->assign(credit_card->TypeAndLastFourDigits());
|
| + if (body) {
|
| + body->assign(l10n_util::GetStringUTF16(
|
| + IDS_AUTOFILL_DELETE_CREDIT_CARD_SUGGESTION_CONFIRMATION_BODY));
|
| + }
|
| +
|
| + return true;
|
| + } else if (GetProfile(identifier, &profile, &variant)) {
|
| + if (profile->record_type() != AutofillProfile::LOCAL_PROFILE)
|
| + return false;
|
| +
|
| + if (title) {
|
| + base::string16 street_address = profile->GetRawInfo(ADDRESS_HOME_CITY);
|
| + if (!street_address.empty())
|
| + title->swap(street_address);
|
| + else
|
| + title->assign(value);
|
| + }
|
| + if (body) {
|
| + body->assign(l10n_util::GetStringUTF16(
|
| + IDS_AUTOFILL_DELETE_PROFILE_SUGGESTION_CONFIRMATION_BODY));
|
| + }
|
| +
|
| + return true;
|
| + }
|
| +
|
| + NOTREACHED();
|
| + return false;
|
| +}
|
| +
|
| bool AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) {
|
| std::string guid;
|
| size_t variant = 0;
|
|
|