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

Unified Diff: chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc

Issue 969223002: Autofill wallet -- handle several classes of error in unmasking prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: local Created 5 years, 10 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: chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc b/chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc
index 62b044a00240f0f1cb266055a7f7c741d939aeae..9b5335cc2c2b02629c09aa8e2971be5c718ea6e7 100644
--- a/chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc
+++ b/chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc
@@ -44,9 +44,39 @@ void CardUnmaskPromptControllerImpl::ShowPrompt(
card_unmask_view_ = CardUnmaskPromptView::CreateAndShow(this);
}
-void CardUnmaskPromptControllerImpl::OnVerificationResult(bool success) {
- if (card_unmask_view_)
- card_unmask_view_->GotVerificationResult(success);
+void CardUnmaskPromptControllerImpl::OnVerificationResult(
+ AutofillClient::GetRealPanResult result) {
+ if (!card_unmask_view_)
+ return;
+
+ base::string16 error_message;
+ bool allow_retry = true;
+ switch (result) {
+ case AutofillClient::SUCCESS:
+ break;
+
+ case AutofillClient::TRY_AGAIN_FAILURE: {
+ error_message = l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_TRY_AGAIN);
+ break;
+ }
+
+ case AutofillClient::PERMANENT_FAILURE: {
+ error_message = l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_PERMANENT);
+ allow_retry = false;
+ break;
+ }
+
+ case AutofillClient::NETWORK_ERROR: {
+ error_message = l10n_util::GetStringUTF16(
+ IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_NETWORK);
+ allow_retry = false;
+ break;
+ }
+ }
+
+ card_unmask_view_->GotVerificationResult(error_message, allow_retry);
}
void CardUnmaskPromptControllerImpl::OnUnmaskDialogClosed() {
« no previous file with comments | « chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.h ('k') | chrome/browser/ui/autofill/card_unmask_prompt_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698