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

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

Issue 2744633002: [Web Payments] Add the shipping method section to the payment sheet (Closed)
Patch Set: Rename shipping method to shipping option. 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
Index: components/payments/content/payment_request.h
diff --git a/components/payments/content/payment_request.h b/components/payments/content/payment_request.h
index 7630c4289234c0218c0db7713f146d5bdb16ee4f..8ae228f5dab23bb4a1683243ebb4334ac3cac281 100644
--- a/components/payments/content/payment_request.h
+++ b/components/payments/content/payment_request.h
@@ -130,6 +130,10 @@ class PaymentRequest : public mojom::PaymentRequest,
// card.
autofill::CreditCard* selected_credit_card() { return selected_credit_card_; }
+ payments::mojom::PaymentShippingOption* selected_shipping_option() {
+ return selected_shipping_option_;
+ }
+
// Sets the |profile| to be the selected one and will update state and notify
// observers.
void SetSelectedShippingProfile(autofill::AutofillProfile* profile);
@@ -180,6 +184,11 @@ class PaymentRequest : public mojom::PaymentRequest,
// (contact info, shipping address).
bool ArePaymentOptionsSatisfied();
+ // Updates the selected_shipping_option based on the data passed to this
+ // payment request by the website. This will set selected_shipping_option_ to
+ // the last option marked selected in the options array.
+ void UpdateSelectedShippingOptionFromDetails();
+
content::WebContents* web_contents_;
std::unique_ptr<PaymentRequestDelegate> delegate_;
// |manager_| owns this PaymentRequest.
@@ -208,6 +217,9 @@ class PaymentRequest : public mojom::PaymentRequest,
std::vector<std::unique_ptr<autofill::CreditCard>> card_cache_;
std::vector<autofill::CreditCard*> credit_cards_;
autofill::CreditCard* selected_credit_card_;
+ // This is owned by |details_|, which is owned by this object and lives until
+ // |this| is destructed so it's safe to keep this raw pointer.
+ payments::mojom::PaymentShippingOption* selected_shipping_option_;
DISALLOW_COPY_AND_ASSIGN(PaymentRequest);
};
« no previous file with comments | « chrome/browser/ui/views/payments/payment_sheet_view_controller.cc ('k') | components/payments/content/payment_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698