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

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

Issue 2775343002: PaymentHandler: Initial implementation for PaymentInstruments. (Closed)
Patch Set: PaymentHandler: Initial implementation for PaymentInstruments. Created 3 years, 8 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 PaymentManager_h 5 #ifndef PaymentManager_h
6 #define PaymentManager_h 6 #define PaymentManager_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptWrappable.h" 9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "components/payments/content/payment_app.mojom-blink.h" 10 #include "components/payments/content/payment_app.mojom-blink.h"
11 #include "modules/ModulesExport.h" 11 #include "modules/ModulesExport.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class PaymentAppManifest; 16 class PaymentAppManifest;
17 class PaymentInstruments;
17 class ScriptPromiseResolver; 18 class ScriptPromiseResolver;
18 class ScriptState; 19 class ScriptState;
19 class ServiceWorkerRegistration; 20 class ServiceWorkerRegistration;
20 21
21 class MODULES_EXPORT PaymentManager final 22 class MODULES_EXPORT PaymentManager final
22 : public GarbageCollectedFinalized<PaymentManager>, 23 : public GarbageCollectedFinalized<PaymentManager>,
23 public ScriptWrappable { 24 public ScriptWrappable {
24 DEFINE_WRAPPERTYPEINFO(); 25 DEFINE_WRAPPERTYPEINFO();
25 WTF_MAKE_NONCOPYABLE(PaymentManager); 26 WTF_MAKE_NONCOPYABLE(PaymentManager);
26 27
27 public: 28 public:
28 static PaymentManager* create(ServiceWorkerRegistration*); 29 static PaymentManager* create(ServiceWorkerRegistration*);
29 30
30 ScriptPromise setManifest(ScriptState*, const PaymentAppManifest&); 31 ScriptPromise setManifest(ScriptState*, const PaymentAppManifest&);
31 ScriptPromise getManifest(ScriptState*); 32 ScriptPromise getManifest(ScriptState*);
32 33
34 PaymentInstruments* instruments();
35
33 DECLARE_TRACE(); 36 DECLARE_TRACE();
34 37
35 private: 38 private:
36 explicit PaymentManager(ServiceWorkerRegistration*); 39 explicit PaymentManager(ServiceWorkerRegistration*);
37 40
38 void onSetManifest(ScriptPromiseResolver*, 41 void onSetManifest(ScriptPromiseResolver*,
39 payments::mojom::blink::PaymentAppManifestError); 42 payments::mojom::blink::PaymentAppManifestError);
40 void onGetManifest(ScriptPromiseResolver*, 43 void onGetManifest(ScriptPromiseResolver*,
41 payments::mojom::blink::PaymentAppManifestPtr, 44 payments::mojom::blink::PaymentAppManifestPtr,
42 payments::mojom::blink::PaymentAppManifestError); 45 payments::mojom::blink::PaymentAppManifestError);
43 void onServiceConnectionError(); 46 void onServiceConnectionError();
44 47
45 Member<ServiceWorkerRegistration> m_registration; 48 Member<ServiceWorkerRegistration> m_registration;
49 Member<PaymentInstruments> m_instruments;
46 payments::mojom::blink::PaymentManagerPtr m_manager; 50 payments::mojom::blink::PaymentManagerPtr m_manager;
47 }; 51 };
48 52
49 } // namespace blink 53 } // namespace blink
50 54
51 #endif // PaymentManager_h 55 #endif // PaymentManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698