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

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

Issue 2836353002: [Payments] Normalize shipping address change on Desktop (Closed)
Patch Set: Addressed Math's comments Created 3 years, 8 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/BUILD.gn ('k') | components/payments/content/payment_request_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/payment_request_state.h
diff --git a/components/payments/content/payment_request_state.h b/components/payments/content/payment_request_state.h
index 9ff914228203d2271ad19c622810816074762d54..9749ca4507e84118770781eaad70fc69c241c6ec 100644
--- a/components/payments/content/payment_request_state.h
+++ b/components/payments/content/payment_request_state.h
@@ -11,7 +11,9 @@
#include "base/macros.h"
#include "base/observer_list.h"
+#include "components/payments/content/payment_request_spec.h"
#include "components/payments/content/payment_response_helper.h"
+#include "components/payments/core/address_normalizer.h"
#include "components/payments/mojom/payment_request.mojom.h"
namespace autofill {
@@ -25,13 +27,14 @@ namespace payments {
class PaymentInstrument;
class PaymentRequestDelegate;
-class PaymentRequestSpec;
// Keeps track of the information currently selected by the user and whether the
// user is ready to pay. Uses information from the PaymentRequestSpec, which is
// what the merchant has specified, as input into the "is ready to pay"
// computation.
-class PaymentRequestState : public PaymentResponseHelper::Delegate {
+class PaymentRequestState : public PaymentResponseHelper::Delegate,
+ public AddressNormalizer::Delegate,
+ public PaymentRequestSpec::Observer {
public:
// Any class call add itself as Observer via AddObserver() and receive
// notification about the state changing.
@@ -73,6 +76,15 @@ class PaymentRequestState : public PaymentResponseHelper::Delegate {
void OnPaymentResponseReady(
mojom::PaymentResponsePtr payment_response) override;
+ // AddressNormalizer::Delegate
+ void OnAddressNormalized(
+ const autofill::AutofillProfile& normalized_profile) override;
+ void OnCouldNotNormalize(const autofill::AutofillProfile& profile) override;
+
+ // PaymentRequestSpec::Observer
+ void OnStartUpdating(PaymentRequestSpec::UpdateReason reason) override {}
+ void OnSpecUpdated() override;
+
// Returns whether the user has at least one instrument that satisfies the
// specified supported payment methods.
bool CanMakePayment() const;
@@ -172,6 +184,9 @@ class PaymentRequestState : public PaymentResponseHelper::Delegate {
bool is_ready_to_pay_;
+ // Whether the data is currently being validated by the merchant.
+ bool is_waiting_for_merchant_validation_;
+
const std::string app_locale_;
// Not owned. Never null. Both outlive this object.
« no previous file with comments | « components/payments/content/BUILD.gn ('k') | components/payments/content/payment_request_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698