Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cce765d6e647db3016f113244e6ce0d9677b61b7 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h |
| @@ -0,0 +1,68 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef PaymentRequest_h |
| +#define PaymentRequest_h |
| + |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "bindings/core/v8/ScriptValue.h" |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/dom/ActiveDOMObject.h" |
| +#include "core/events/EventTarget.h" |
| +#include "modules/payments/PaymentDetails.h" |
| +#include "modules/payments/PaymentOptions.h" |
| +#include "modules/payments/ShippingAddress.h" |
| +#include "platform/heap/Handle.h" |
| +#include "wtf/Noncopyable.h" |
| +#include "wtf/Vector.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class ExecutionContext; |
| +class ScriptState; |
| + |
| +class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>, public ActiveDOMObject { |
| + REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PaymentRequest); |
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PaymentRequest); |
| + DEFINE_WRAPPERTYPEINFO(); |
| + WTF_MAKE_NONCOPYABLE(PaymentRequest); |
| + |
| +public: |
| + static PaymentRequest* create(ExecutionContext*, const Vector<String>&, const PaymentDetails&, const PaymentOptions& = PaymentOptions(), const ScriptValue& = ScriptValue()); |
|
Marijn Kruisselbrink
2016/02/18 21:59:18
you should include parameter names for the paramet
please use gerrit instead
2016/02/18 22:41:33
Done.
ScriptValue's param name is "data" in the s
|
| + |
| + PaymentRequest(ExecutionContext*, const Vector<String>&, const PaymentDetails&, const PaymentOptions&, const ScriptValue&); |
|
Marijn Kruisselbrink
2016/02/18 21:59:18
Since you have a static create method, you probabl
please use gerrit instead
2016/02/18 22:41:33
Done.
|
| + virtual ~PaymentRequest(); |
| + |
| + ScriptPromise show(ScriptState*); |
| + void abort(); |
| + |
| + ShippingAddress* shippingAddress() const { return m_shippingAddress.get(); } |
| + const String& shippingOption() const { return m_shippingOption; } |
| + |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); |
| + |
| + // EventTargetWithInlineData: |
| + const AtomicString& interfaceName() const override; |
| + ExecutionContext* executionContext() const override; |
| + |
| + // ActiveDOMObject: |
| + bool hasPendingActivity() const override; |
| + void stop() override; |
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + Vector<String> m_supportedMethods; |
| + PaymentDetails m_details; |
| + PaymentOptions m_options; |
| + ScriptValue m_data; |
|
Marijn Kruisselbrink
2016/02/18 21:59:18
If I understand things correctly ScriptValue is ha
please use gerrit instead
2016/02/18 22:41:33
Acknowledged.
|
| + Member<ShippingAddress> m_shippingAddress; |
| + String m_shippingOption; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // PaymentRequest_h |