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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.h

Issue 1753543002: PaymentRequest Mojo bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface
Patch Set: Rename WebStuff into PlatformStuff Created 4 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: third_party/WebKit/Source/modules/payments/PaymentRequest.h
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
index 8f92cca3a6e06497f9e159026ec104d502e0f928..7d7270b5dde919458f83fc3381046edcdd01d064 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
@@ -12,6 +12,7 @@
#include "modules/payments/PaymentDetails.h"
#include "modules/payments/PaymentOptions.h"
#include "platform/heap/Handle.h"
+#include "platform/payments/PaymentRequestProxy.h"
#include "wtf/Noncopyable.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
@@ -20,10 +21,11 @@
namespace blink {
class ExceptionState;
+class ScriptPromiseResolver;
class ScriptState;
class ShippingAddress;
-class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest> {
+class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>, PaymentRequestProxy::Listener {
REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PaymentRequest);
DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(PaymentRequest);
@@ -36,7 +38,7 @@ public:
virtual ~PaymentRequest();
ScriptPromise show(ScriptState*);
- void abort();
+ void abort(ExceptionState&);
ShippingAddress* shippingAddress() const { return m_shippingAddress.get(); }
const String& shippingOption() const { return m_shippingOption; }
@@ -48,11 +50,20 @@ public:
const AtomicString& interfaceName() const override;
ExecutionContext* executionContext() const override;
+ ScriptPromise complete(ScriptState*, bool success);
+
DECLARE_TRACE();
private:
PaymentRequest(ScriptState*, const Vector<String>& supportedMethods, const PaymentDetails&, const PaymentOptions&, const ScriptValue& data, ExceptionState&);
+ // PaymentRequestProxy::Listener
+ void onShippingAddressChange(const PlatformShippingAddress&) override;
+ void onShippingOptionChange(const String& shippingOptionId) override;
+ void onPaymentResponse(const PlatformPaymentResponse&) override;
+ void onError() override;
+ void onComplete() override;
+
RefPtr<ScriptState> m_scriptState;
Vector<String> m_supportedMethods;
PaymentDetails m_details;
@@ -60,6 +71,9 @@ private:
String m_stringifiedData;
Member<ShippingAddress> m_shippingAddress;
String m_shippingOption;
+ Member<ScriptPromiseResolver> m_showResolver;
+ Member<ScriptPromiseResolver> m_completeResolver;
+ PaymentRequestProxy m_paymentRequestProxy;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698