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

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

Issue 870203002: Add status to server credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add TODO Created 5 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: 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 609ecdb619461be657ba705386caaa2bc0eca7c6..7f23b62a58bf2327b35ae62cbd913414cba15dd2 100644
--- a/chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc
+++ b/chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.cc
@@ -58,10 +58,24 @@ content::WebContents* CardUnmaskPromptControllerImpl::GetWebContents() {
}
base::string16 CardUnmaskPromptControllerImpl::GetWindowTitle() const {
- return base::ASCIIToUTF16("Unlocking ") + card_.TypeAndLastFourDigits();
+ // TODO(estade): i18n.
+ if (card_.GetServerStatus() == CreditCard::EXPIRED) {
+ return base::ASCIIToUTF16("Update and verify your card ") +
+ card_.TypeAndLastFourDigits();
+ }
+
+ return base::ASCIIToUTF16("Verify your card ") +
+ card_.TypeAndLastFourDigits();
}
base::string16 CardUnmaskPromptControllerImpl::GetInstructionsMessage() const {
+ if (card_.GetServerStatus() == CreditCard::EXPIRED) {
+ return l10n_util::GetStringUTF16(
+ card_.type() == kAmericanExpressCard
+ ? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED_AMEX
+ : IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED);
+ }
+
return l10n_util::GetStringUTF16(
card_.type() == kAmericanExpressCard
? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_AMEX
@@ -73,6 +87,10 @@ int CardUnmaskPromptControllerImpl::GetCvcImageRid() const {
: IDR_CREDIT_CARD_CVC_HINT;
}
+bool CardUnmaskPromptControllerImpl::ShouldRequestExpirationDate() const {
+ return card_.GetServerStatus() == CreditCard::EXPIRED;
+}
+
bool CardUnmaskPromptControllerImpl::InputTextIsValid(
const base::string16& input_text) const {
base::string16 trimmed_text;
« no previous file with comments | « chrome/browser/ui/autofill/card_unmask_prompt_controller_impl.h ('k') | components/autofill/core/browser/credit_card.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698