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

Unified Diff: components/payments/payment_request.h

Issue 2698353002: [Payments] Add the "Cards accepted" row at the top of CC editor. (Closed)
Patch Set: private Created 3 years, 10 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/payments/payment_request.h
diff --git a/components/payments/payment_request.h b/components/payments/payment_request.h
index cd54b7cbcebac0e7c0f69c4430af6aa567740a0c..bde059541f4ca2e7bb42e7b1e581beabbe4c8766 100644
--- a/components/payments/payment_request.h
+++ b/components/payments/payment_request.h
@@ -39,7 +39,7 @@ class PaymentRequest : payments::mojom::PaymentRequest {
// payments::mojom::PaymentRequest "stub"
void Init(payments::mojom::PaymentRequestClientPtr client,
- std::vector<payments::mojom::PaymentMethodDataPtr> methodData,
+ std::vector<payments::mojom::PaymentMethodDataPtr> method_data,
payments::mojom::PaymentDetailsPtr details,
payments::mojom::PaymentOptionsPtr options) override;
void Show() override;
@@ -101,6 +101,9 @@ class PaymentRequest : payments::mojom::PaymentRequest {
}
payments::mojom::PaymentDetails* details() { return details_.get(); }
+ const std::vector<std::string>& supported_card_networks() {
+ return supported_card_networks_;
+ }
content::WebContents* web_contents() { return web_contents_; }
private:
@@ -111,6 +114,10 @@ class PaymentRequest : payments::mojom::PaymentRequest {
// Sets the default values for the selected Shipping and Contact profiles.
void SetDefaultProfileSelections();
+ // Validates the |method_data| and fills |supported_card_networks_|.
+ void PopulateValidatedMethodData(
+ const std::vector<payments::mojom::PaymentMethodDataPtr>& method_data);
+
content::WebContents* web_contents_;
std::unique_ptr<PaymentRequestDelegate> delegate_;
// |manager_| owns this PaymentRequest.
@@ -119,6 +126,8 @@ class PaymentRequest : payments::mojom::PaymentRequest {
payments::mojom::PaymentRequestClientPtr client_;
payments::mojom::PaymentDetailsPtr details_;
std::unique_ptr<CurrencyFormatter> currency_formatter_;
+ // A set of supported basic card networks.
+ std::vector<std::string> supported_card_networks_;
// Profiles may change due to (e.g.) sync events, so profiles are cached after
// loading and owned here. They are populated once only, and ordered by
« no previous file with comments | « chrome/browser/ui/views/payments/payment_sheet_view_controller.cc ('k') | components/payments/payment_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698