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

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

Issue 23510010: [rac] Show amex-specific cvc hint for saved autofill card (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | components/autofill/content/browser/wallet/wallet_items.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 636f935e6a0503759d0b097a2f76f8cd2d47a863..5bb4288a52a03ea55f01576b14140a5f4d44e50b 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -546,9 +546,9 @@ gfx::Image CreditCardIconForType(const std::string& credit_card_type) {
return result;
}
-gfx::Image CvcIconForCreditCardType(const std::string& credit_card_type) {
+gfx::Image CvcIconForCreditCardType(const base::string16& credit_card_type) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- if (credit_card_type == autofill::kAmericanExpressCard)
+ if (credit_card_type == l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_AMEX))
return rb.GetImageNamed(IDR_CREDIT_CARD_CVC_HINT_AMEX);
return rb.GetImageNamed(IDR_CREDIT_CARD_CVC_HINT);
@@ -1539,7 +1539,7 @@ gfx::Image AutofillDialogControllerImpl::ExtraSuggestionIconForSection(
return gfx::Image();
return CvcIconForCreditCardType(
- UTF16ToUTF8(model->GetInfo(AutofillType(CREDIT_CARD_TYPE))));
+ model->GetInfo(AutofillType(CREDIT_CARD_TYPE)));
}
// TODO(groby): Remove this deprecated method after Mac starts using
@@ -1570,14 +1570,15 @@ gfx::Image AutofillDialogControllerImpl::IconForField(
FieldIconMap AutofillDialogControllerImpl::IconsForFields(
const FieldValueMap& user_inputs) const {
FieldIconMap result;
- std::string credit_card_type = autofill::kGenericCard;
+ base::string16 credit_card_type;
FieldValueMap::const_iterator credit_card_iter =
user_inputs.find(CREDIT_CARD_NUMBER);
if (credit_card_iter != user_inputs.end()) {
- const string16& credit_card_number = credit_card_iter->second;
- credit_card_type = CreditCard::GetCreditCardType(credit_card_number);
- result[CREDIT_CARD_NUMBER] = CreditCardIconForType(credit_card_type);
+ const string16& number = credit_card_iter->second;
+ const std::string type = CreditCard::GetCreditCardType(number);
+ credit_card_type = CreditCard::TypeForDisplay(type);
+ result[CREDIT_CARD_NUMBER] = CreditCardIconForType(type);
}
if (!user_inputs.count(CREDIT_CARD_VERIFICATION_CODE))
« no previous file with comments | « no previous file | components/autofill/content/browser/wallet/wallet_items.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698