Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Justin's nits. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c0bcd671f7f05136387b47166770c29b76c1012c..ee65bb88f31fe51f43a11fb5ba0df876112df337 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -677,7 +677,7 @@ bool AutofillManager::GetDeletionConfirmationText(const base::string16& value,
return false;
if (title)
- title->assign(credit_card->TypeAndLastFourDigits());
+ title->assign(credit_card->TypeAndLastFourDigitsForDisplay());
if (body) {
body->assign(l10n_util::GetStringUTF16(
IDS_AUTOFILL_DELETE_CREDIT_CARD_SUGGESTION_CONFIRMATION_BODY));
@@ -848,9 +848,9 @@ void AutofillManager::OnDidGetUploadDetails(
upload_request_.context_token = context_token;
user_did_accept_upload_prompt_ = false;
client_->ConfirmSaveCreditCardToCloud(
+ upload_request_.card, std::move(legal_message),
base::Bind(&AutofillManager::OnUserDidAcceptUpload,
- weak_ptr_factory_.GetWeakPtr()),
- std::move(legal_message));
+ weak_ptr_factory_.GetWeakPtr()));
client_->LoadRiskData(base::Bind(&AutofillManager::OnDidGetUploadRiskData,
weak_ptr_factory_.GetWeakPtr()));
AutofillMetrics::LogCardUploadDecisionMetric(
@@ -867,9 +867,11 @@ void AutofillManager::OnDidGetUploadDetails(
// the upload details request will consistently fail and if we don't fall
// back to a local save then the user will never be offered any kind of
// credit card save.
- client_->ConfirmSaveCreditCardLocally(base::Bind(
- base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard),
- base::Unretained(personal_data_), upload_request_.card));
+ client_->ConfirmSaveCreditCardLocally(
+ upload_request_.card,
+ base::Bind(
+ base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard),
+ base::Unretained(personal_data_), upload_request_.card));
AutofillMetrics::LogCardUploadDecisionMetric(
AutofillMetrics::UPLOAD_NOT_OFFERED_GET_UPLOAD_DETAILS_FAILED);
}
@@ -966,16 +968,18 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
if (imported_credit_card) {
// Don't offer to save any cards that were recently unmasked.
for (const CreditCard& unmasked_card : recently_unmasked_cards_) {
- if (unmasked_card.TypeAndLastFourDigits() ==
- imported_credit_card->TypeAndLastFourDigits())
+ if (unmasked_card.TypeAndLastFourDigitsForDisplay() ==
+ imported_credit_card->TypeAndLastFourDigitsForDisplay())
return;
}
upload_request_ = payments::PaymentsClient::UploadRequestDetails();
if (!IsCreditCardUploadEnabled()) {
- client_->ConfirmSaveCreditCardLocally(base::Bind(
- base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard),
- base::Unretained(personal_data_), *imported_credit_card));
+ client_->ConfirmSaveCreditCardLocally(
+ *imported_credit_card,
+ base::Bind(
+ base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard),
+ base::Unretained(personal_data_), *imported_credit_card));
} else {
// Check for a CVC in order to determine whether we can prompt the user to
// upload their card.

Powered by Google App Engine
This is Rietveld 408576698