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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.h

Issue 1702223002: PaymentRequest API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PaymentRequest_h
6 #define PaymentRequest_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptValue.h"
10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "core/dom/ActiveDOMObject.h"
12 #include "core/events/EventTarget.h"
13 #include "modules/payments/PaymentDetails.h"
14 #include "modules/payments/PaymentOptions.h"
15 #include "modules/payments/ShippingAddress.h"
16 #include "platform/heap/Handle.h"
17 #include "wtf/Noncopyable.h"
18 #include "wtf/Vector.h"
19 #include "wtf/text/WTFString.h"
20
21 namespace blink {
22
23 class ExecutionContext;
24 class ScriptState;
25
26 class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInl ineData<PaymentRequest>, public ActiveDOMObject {
27 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PaymentRequest);
28 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PaymentRequest);
29 DEFINE_WRAPPERTYPEINFO();
30 WTF_MAKE_NONCOPYABLE(PaymentRequest);
31
32 public:
33 static PaymentRequest* create(ExecutionContext*, const Vector<String>&, cons t 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
34
35 PaymentRequest(ExecutionContext*, const Vector<String>&, const PaymentDetail s&, 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.
36 virtual ~PaymentRequest();
37
38 ScriptPromise show(ScriptState*);
39 void abort();
40
41 ShippingAddress* shippingAddress() const { return m_shippingAddress.get(); }
42 const String& shippingOption() const { return m_shippingOption; }
43
44 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange);
45 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange);
46
47 // EventTargetWithInlineData:
48 const AtomicString& interfaceName() const override;
49 ExecutionContext* executionContext() const override;
50
51 // ActiveDOMObject:
52 bool hasPendingActivity() const override;
53 void stop() override;
54
55 DECLARE_TRACE();
56
57 private:
58 Vector<String> m_supportedMethods;
59 PaymentDetails m_details;
60 PaymentOptions m_options;
61 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.
62 Member<ShippingAddress> m_shippingAddress;
63 String m_shippingOption;
64 };
65
66 } // namespace blink
67
68 #endif // PaymentRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698