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

Unified Diff: components/payments/content/payment_request_spec.h

Issue 2757523002: [Payments] Use PaymentInstrument/AutofillPaymentInstrument throughout. (Closed)
Patch Set: addressed nits Created 3 years, 9 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 | « components/payments/content/payment_request.cc ('k') | components/payments/content/payment_request_spec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/payment_request_spec.h
diff --git a/components/payments/content/payment_request_spec.h b/components/payments/content/payment_request_spec.h
index d205a1bb4abaa69943b93f04c2b67a8eb0f9a344..729d7ca87e978d8aee6d3adf6884425654b254db 100644
--- a/components/payments/content/payment_request_spec.h
+++ b/components/payments/content/payment_request_spec.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_
#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_
+#include <set>
#include <string>
#include <vector>
@@ -46,9 +47,12 @@ class PaymentRequestSpec {
bool request_payer_phone() const { return options_->request_payer_phone; }
bool request_payer_email() const { return options_->request_payer_email; }
- const std::vector<std::string>& supported_card_networks() {
+ const std::vector<std::string>& supported_card_networks() const {
return supported_card_networks_;
}
+ const std::set<std::string>& supported_card_networks_set() const {
+ return supported_card_networks_set_;
+ }
// Uses CurrencyFormatter to format |amount| with the currency symbol for this
// request's currency. Will use currency of the "total" display item, because
@@ -85,9 +89,11 @@ class PaymentRequestSpec {
const std::string app_locale_;
std::unique_ptr<CurrencyFormatter> currency_formatter_;
- // A list of supported basic card networks, in order that they were specified
- // by the merchant.
+ // A list/set of supported basic card networks. The list is used to keep the
+ // order in which they were specified by the merchant. The set is used for
+ // fast lookup of supported methods.
std::vector<std::string> supported_card_networks_;
+ std::set<std::string> supported_card_networks_set_;
base::ObserverList<Observer> observers_;
« no previous file with comments | « components/payments/content/payment_request.cc ('k') | components/payments/content/payment_request_spec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698