| 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 "modules/EventModules.h" | 8 #include "modules/EventModules.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class BeforeInstallPromptEventInit; | 13 class BeforeInstallPromptEventInit; |
| 14 | 14 |
| 15 class BeforeInstallPromptEvent final : public Event { | 15 class BeforeInstallPromptEvent final : public Event { |
| 16 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
| 17 public: | 17 public: |
| 18 virtual ~BeforeInstallPromptEvent(); | 18 virtual ~BeforeInstallPromptEvent(); |
| 19 | 19 |
| 20 // For EventModules.cpp | 20 // For EventModules.cpp |
| 21 static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create() | 21 static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create() |
| 22 { | 22 { |
| 23 return adoptRefWillBeNoop(new BeforeInstallPromptEvent()); | 23 return adoptRefWillBeNoop(new BeforeInstallPromptEvent()); |
| 24 } | 24 } |
| 25 | 25 |
| 26 static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicS
tring& name, const String& platform) | 26 static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicS
tring& name, const Vector<String>& platforms) |
| 27 { | 27 { |
| 28 return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, platform)); | 28 return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, platforms))
; |
| 29 } | 29 } |
| 30 | 30 |
| 31 static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicS
tring& name, const BeforeInstallPromptEventInit& init) | 31 static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicS
tring& name, const BeforeInstallPromptEventInit& init) |
| 32 { | 32 { |
| 33 return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, init)); | 33 return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, init)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 String platform() const; | 36 Vector<String> platforms() const; |
| 37 ScriptPromise userChoice(ScriptState*) const; | 37 ScriptPromise userChoice(ScriptState*) const; |
| 38 | 38 |
| 39 virtual const AtomicString& interfaceName() const override; | 39 virtual const AtomicString& interfaceName() const override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 BeforeInstallPromptEvent(); | 42 BeforeInstallPromptEvent(); |
| 43 BeforeInstallPromptEvent(const AtomicString& name, const String& platform); | 43 BeforeInstallPromptEvent(const AtomicString& name, const Vector<String>& pla
tforms); |
| 44 BeforeInstallPromptEvent(const AtomicString& name, const BeforeInstallPrompt
EventInit&); | 44 BeforeInstallPromptEvent(const AtomicString& name, const BeforeInstallPrompt
EventInit&); |
| 45 | 45 |
| 46 String m_platform; | 46 Vector<String> m_platforms; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 DEFINE_TYPE_CASTS(BeforeInstallPromptEvent, Event, event, event->interfaceName()
== EventNames::BeforeInstallPromptEvent, event.interfaceName() == EventNames::B
eforeInstallPromptEvent); | 49 DEFINE_TYPE_CASTS(BeforeInstallPromptEvent, Event, event, event->interfaceName()
== EventNames::BeforeInstallPromptEvent, event.interfaceName() == EventNames::B
eforeInstallPromptEvent); |
| 50 | 50 |
| 51 } // namespace blink | 51 } // namespace blink |
| 52 | 52 |
| 53 #endif // BeforeInstallPromptEvent_h | 53 #endif // BeforeInstallPromptEvent_h |
| OLD | NEW |