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

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

Issue 2808633002: [Payments] Move PaymentResponse logic to PaymentResponseHelper. (Closed)
Patch Set: Nit 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 f1d067bbeac2251eea2664d19b9d3f572a02b0c1..4f5f96a57cd775638375aff64f6e8b4212d98b3c 100644
--- a/components/payments/content/payment_request_state.h
+++ b/components/payments/content/payment_request_state.h
@@ -11,8 +11,7 @@
#include "base/macros.h"
#include "base/observer_list.h"
#include "components/payments/content/payment_request.mojom.h"
-#include "components/payments/core/autofill_payment_instrument.h"
-#include "components/payments/core/payment_instrument.h"
+#include "components/payments/content/payment_response_helper.h"
namespace autofill {
class AutofillProfile;
@@ -21,6 +20,7 @@ class PersonalDataManager;
namespace payments {
+class PaymentInstrument;
class PaymentRequestDelegate;
class PaymentRequestSpec;
@@ -28,7 +28,7 @@ class PaymentRequestSpec;
// 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 PaymentInstrument::Delegate {
+class PaymentRequestState : public PaymentResponseHelper::Delegate {
public:
// Any class call add itself as Observer via AddObserver() and receive
// notification about the state changing.
@@ -66,18 +66,16 @@ class PaymentRequestState : public PaymentInstrument::Delegate {
PaymentRequestDelegate* payment_request_delegate);
~PaymentRequestState() override;
+ // PaymentResponseHelper::Delegate
+ void OnPaymentResponseReady(
+ mojom::PaymentResponsePtr payment_response) override;
+
// Returns whether the user has at least one instrument that satisfies the
// specified supported payment methods.
bool CanMakePayment() const;
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
- // PaymentInstrument::Delegate:
- void OnInstrumentDetailsReady(
- const std::string& method_name,
- const std::string& stringified_details) override;
- void OnInstrumentDetailsError() override {}
-
// Initiates the generation of the PaymentResponse. Callers should check
// |is_ready_to_pay|, which is inexpensive.
void GeneratePaymentResponse();
@@ -174,6 +172,8 @@ class PaymentRequestState : public PaymentInstrument::Delegate {
PaymentRequestDelegate* payment_request_delegate_;
+ std::unique_ptr<PaymentResponseHelper> response_helper_;
+
base::ObserverList<Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(PaymentRequestState);
« 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