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

Unified Diff: components/payments/core/autofill_payment_instrument.h

Issue 2842463002: [Payments] Normalize billing address for response on Desktop. (Closed)
Patch Set: Addressed moe'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
Index: components/payments/core/autofill_payment_instrument.h
diff --git a/components/payments/core/autofill_payment_instrument.h b/components/payments/core/autofill_payment_instrument.h
index c0e4921529e7e8be11ca9f3f09da14e8cc10a849..315e07ee4e5aee0e2c41e55f4d0daddafe4015e4 100644
--- a/components/payments/core/autofill_payment_instrument.h
+++ b/components/payments/core/autofill_payment_instrument.h
@@ -10,14 +10,12 @@
#include <vector>
#include "base/macros.h"
+#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/payments/full_card_request.h"
+#include "components/payments/core/address_normalizer.h"
#include "components/payments/core/payment_instrument.h"
-namespace autofill {
-class AutofillProfile;
-}
-
namespace payments {
class PaymentRequestDelegate;
@@ -26,7 +24,8 @@ class PaymentRequestDelegate;
// Request.
class AutofillPaymentInstrument
: public PaymentInstrument,
- public autofill::payments::FullCardRequest::ResultDelegate {
+ public autofill::payments::FullCardRequest::ResultDelegate,
+ public AddressNormalizer::Delegate {
public:
// |billing_profiles| is owned by the caller and should outlive this object.
// |payment_request_delegate| must outlive this object.
@@ -49,9 +48,17 @@ class AutofillPaymentInstrument
const base::string16& cvc) override;
void OnFullCardRequestFailed() override;
+ // AddressNormalizer::Delegate:
+ void OnAddressNormalized(
+ const autofill::AutofillProfile& normalized_profile) override;
+ void OnCouldNotNormalize(const autofill::AutofillProfile& profile) override;
+
autofill::CreditCard* credit_card() { return &credit_card_; }
private:
+ // Generates the basic card response and sends it to the delegate.
+ void GenerateBasicCardResponse();
+
// A copy of the card is owned by this object.
autofill::CreditCard credit_card_;
// Not owned by this object, should outlive this.
@@ -61,6 +68,12 @@ class AutofillPaymentInstrument
PaymentInstrument::Delegate* delegate_;
PaymentRequestDelegate* payment_request_delegate_;
+ autofill::AutofillProfile billing_address_;
+
+ base::string16 cvc_;
+
+ bool is_waiting_for_card_unmask_;
+ bool is_waiting_for_billing_address_normalization_;
base::WeakPtrFactory<AutofillPaymentInstrument> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698