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

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

Issue 2285523002: Add support for method selection in the Payment Request UI on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clear dictionaries before parsing. Created 4 years, 4 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_data_util.cc
diff --git a/components/autofill/core/browser/autofill_data_util.cc b/components/autofill/core/browser/autofill_data_util.cc
index 955a6c20f8d2970e212d61ae6febe04dd7643ddf..2b45d9d29886a230ad3e138f911b77659e915537 100644
--- a/components/autofill/core/browser/autofill_data_util.cc
+++ b/components/autofill/core/browser/autofill_data_util.cc
@@ -383,5 +383,23 @@ bool ProfileMatchesFullName(const base::string16 full_name,
return false;
}
+const PaymentRequestData& GetPaymentRequestData(const std::string& type) {
+ for (size_t i = 0; i < arraysize(kPaymentRequestData); ++i) {
+ if (type == kPaymentRequestData[i].card_type)
+ return kPaymentRequestData[i];
+ }
+ return kPaymentRequestData[0];
Evan Stade 2016/08/29 20:34:05 seems fairly fragile that you're depending on the
Justin Donnelly 2016/08/30 15:21:25 Done.
+}
+
+const char* GetCardTypeForBasicCardPaymentType(
+ const std::string& basic_card_payment_type) {
+ for (size_t i = 0; i < arraysize(kPaymentRequestData); ++i) {
+ if (basic_card_payment_type ==
+ kPaymentRequestData[i].basic_card_payment_type)
+ return kPaymentRequestData[i].card_type;
+ }
+ return kPaymentRequestData[0].card_type;
+}
+
} // namespace data_util
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698