OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BeforeInstallPromptEvent_h | 5 #ifndef BeforeInstallPromptEvent_h |
6 #define BeforeInstallPromptEvent_h | 6 #define BeforeInstallPromptEvent_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "modules/EventModules.h" | 10 #include "modules/EventModules.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 class BeforeInstallPromptEventInit; | 15 class BeforeInstallPromptEventInit; |
15 class WebAppBannerClient; | 16 class WebAppBannerClient; |
16 | 17 |
17 class BeforeInstallPromptEvent final : public Event { | 18 class BeforeInstallPromptEvent final : public Event { |
18 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
(...skipping 22 matching lines...) Expand all Loading... |
41 virtual const AtomicString& interfaceName() const override; | 42 virtual const AtomicString& interfaceName() const override; |
42 | 43 |
43 ScriptPromise prompt(ScriptState*); | 44 ScriptPromise prompt(ScriptState*); |
44 | 45 |
45 private: | 46 private: |
46 BeforeInstallPromptEvent(); | 47 BeforeInstallPromptEvent(); |
47 BeforeInstallPromptEvent(const AtomicString& name, const Vector<String>& pla
tforms, int requestId, WebAppBannerClient*); | 48 BeforeInstallPromptEvent(const AtomicString& name, const Vector<String>& pla
tforms, int requestId, WebAppBannerClient*); |
48 BeforeInstallPromptEvent(const AtomicString& name, const BeforeInstallPrompt
EventInit&); | 49 BeforeInstallPromptEvent(const AtomicString& name, const BeforeInstallPrompt
EventInit&); |
49 | 50 |
50 Vector<String> m_platforms; | 51 Vector<String> m_platforms; |
51 ScriptPromise m_userChoice; | 52 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; |
52 | 53 |
53 int m_requestId; | 54 int m_requestId; |
54 WebAppBannerClient* m_client; | 55 WebAppBannerClient* m_client; |
55 bool m_redispatched; | 56 bool m_redispatched; |
56 }; | 57 }; |
57 | 58 |
58 DEFINE_TYPE_CASTS(BeforeInstallPromptEvent, Event, event, event->interfaceName()
== EventNames::BeforeInstallPromptEvent, event.interfaceName() == EventNames::B
eforeInstallPromptEvent); | 59 DEFINE_TYPE_CASTS(BeforeInstallPromptEvent, Event, event, event->interfaceName()
== EventNames::BeforeInstallPromptEvent, event.interfaceName() == EventNames::B
eforeInstallPromptEvent); |
59 | 60 |
60 } // namespace blink | 61 } // namespace blink |
61 | 62 |
62 #endif // BeforeInstallPromptEvent_h | 63 #endif // BeforeInstallPromptEvent_h |
OLD | NEW |