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

Side by Side Diff: Source/modules/app_banner/BeforeInstallPromptEvent.h

Issue 1089813002: Change beforeinstallprompt event to take an array of platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test expectations Created 5 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 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
OLDNEW
« no previous file with comments | « Source/modules/app_banner/AppBannerController.cpp ('k') | Source/modules/app_banner/BeforeInstallPromptEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698