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

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

Issue 2775193004: [Payments] Have an observer for canMakePayment, for testing. (Closed)
Patch Set: addressed comments 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 b9753dbb41a3d84ed52d7fe050c7ada9e8f33edc..fdfec343216ffcb458396fd4930d5b742b409077 100644
--- a/components/payments/content/payment_request.h
+++ b/components/payments/content/payment_request.h
@@ -34,10 +34,19 @@ class PaymentRequest : public mojom::PaymentRequest,
public PaymentRequestSpec::Observer,
public PaymentRequestState::Delegate {
public:
+ class ObserverForTest {
+ public:
+ virtual void OnCanMakePaymentCalled() = 0;
+
+ protected:
+ virtual ~ObserverForTest() {}
+ };
+
PaymentRequest(content::WebContents* web_contents,
std::unique_ptr<PaymentRequestDelegate> delegate,
PaymentRequestWebContentsManager* manager,
- mojo::InterfaceRequest<mojom::PaymentRequest> request);
+ mojo::InterfaceRequest<mojom::PaymentRequest> request,
+ ObserverForTest* observer_for_testing);
~PaymentRequest() override;
// mojom::PaymentRequest
@@ -87,6 +96,9 @@ class PaymentRequest : public mojom::PaymentRequest,
std::unique_ptr<PaymentRequestSpec> spec_;
std::unique_ptr<PaymentRequestState> state_;
+ // May be null, must outlive this object.
+ ObserverForTest* observer_for_testing_;
+
DISALLOW_COPY_AND_ASSIGN(PaymentRequest);
};

Powered by Google App Engine
This is Rietveld 408576698