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

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: test updates 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..3207ddb26e18d0149f9b297c87925d7fe09128e1 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,23 @@ content::WebContents* CardUnmaskPromptControllerImpl::GetWebContents() {
}
base::string16 CardUnmaskPromptControllerImpl::GetWindowTitle() const {
- return base::ASCIIToUTF16("Unlocking ") + card_.TypeAndLastFourDigits();
+ if (card_.GetServerStatus() == CreditCard::EXPIRED) {
brettw 2015/01/26 06:02:26 Can we add a TODO for doing proper localizing? Or
Evan Stade 2015/01/26 19:41:16 TODO added. The reason I haven't added strings yet
+ 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 +86,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