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

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

Issue 2903643002: PaymentHandler: Implement PaymentRequestEvent constructor. (Closed)
Patch Set: constructor Created 3 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PaymentRequestEvent_h 5 #ifndef PaymentRequestEvent_h
6 #define PaymentRequestEvent_h 6 #define PaymentRequestEvent_h
7 7
8 #include "modules/EventModules.h" 8 #include "modules/EventModules.h"
9 #include "modules/payments/PaymentRequestEventInit.h" 9 #include "modules/payments/PaymentRequestEventInit.h"
10 #include "modules/serviceworkers/ExtendableEvent.h" 10 #include "modules/serviceworkers/ExtendableEvent.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 12
13 namespace WTF { 13 namespace WTF {
14 class AtomicString; 14 class AtomicString;
15 } 15 }
16 16
17 namespace blink { 17 namespace blink {
18 18
19 class RespondWithObserver; 19 class RespondWithObserver;
20 20
21 class MODULES_EXPORT PaymentRequestEvent final : public ExtendableEvent { 21 class MODULES_EXPORT PaymentRequestEvent final : public ExtendableEvent {
22 DEFINE_WRAPPERTYPEINFO(); 22 DEFINE_WRAPPERTYPEINFO();
23 WTF_MAKE_NONCOPYABLE(PaymentRequestEvent); 23 WTF_MAKE_NONCOPYABLE(PaymentRequestEvent);
24 24
25 public: 25 public:
26 static PaymentRequestEvent* Create(const AtomicString& type, 26 static PaymentRequestEvent* Create(const AtomicString& type,
27 const PaymentRequestEventInit&);
28 static PaymentRequestEvent* Create(const AtomicString& type,
27 const PaymentRequestEventInit&, 29 const PaymentRequestEventInit&,
28 RespondWithObserver*, 30 RespondWithObserver*,
29 WaitUntilObserver*); 31 WaitUntilObserver*);
30 ~PaymentRequestEvent() override; 32 ~PaymentRequestEvent() override;
31 33
32 const AtomicString& InterfaceName() const override; 34 const AtomicString& InterfaceName() const override;
33 35
34 const String& topLevelOrigin() const; 36 const String& topLevelOrigin() const;
35 const String& paymentRequestOrigin() const; 37 const String& paymentRequestOrigin() const;
36 const String& paymentRequestId() const; 38 const String& paymentRequestId() const;
37 const HeapVector<PaymentMethodData>& methodData() const; 39 const HeapVector<PaymentMethodData>& methodData() const;
38 void total(PaymentItem& value) const; 40 void total(PaymentItem& value) const;
39 const HeapVector<PaymentDetailsModifier>& modifiers() const; 41 const HeapVector<PaymentDetailsModifier>& modifiers() const;
40 const String& instrumentKey() const; 42 const String& instrumentKey() const;
41 43
42 ScriptPromise openWindow(ScriptState*, const String& url); 44 ScriptPromise openWindow(ScriptState*, const String& url);
43 void respondWith(ScriptState*, ScriptPromise, ExceptionState&); 45 void respondWith(ScriptState*, ScriptPromise, ExceptionState&);
44 46
45 DECLARE_VIRTUAL_TRACE(); 47 DECLARE_VIRTUAL_TRACE();
46 48
47 private: 49 private:
50 PaymentRequestEvent(const AtomicString& type, const PaymentRequestEventInit&);
please use gerrit instead 2017/06/05 15:38:55 Would you mind having a single constructor that bo
zino 2017/06/06 15:03:12 Done.
48 PaymentRequestEvent(const AtomicString& type, 51 PaymentRequestEvent(const AtomicString& type,
49 const PaymentRequestEventInit&, 52 const PaymentRequestEventInit&,
50 RespondWithObserver*, 53 RespondWithObserver*,
51 WaitUntilObserver*); 54 WaitUntilObserver*);
52 55
53 String top_level_origin_; 56 String top_level_origin_;
54 String payment_request_origin_; 57 String payment_request_origin_;
55 String payment_request_id_; 58 String payment_request_id_;
56 HeapVector<PaymentMethodData> method_data_; 59 HeapVector<PaymentMethodData> method_data_;
57 PaymentItem total_; 60 PaymentItem total_;
58 HeapVector<PaymentDetailsModifier> modifiers_; 61 HeapVector<PaymentDetailsModifier> modifiers_;
59 String instrument_key_; 62 String instrument_key_;
60 63
61 Member<RespondWithObserver> observer_; 64 Member<RespondWithObserver> observer_;
62 }; 65 };
63 66
64 } // namespace blink 67 } // namespace blink
65 68
66 #endif // PaymentRequestEvent_h 69 #endif // PaymentRequestEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698