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

Unified Diff: Source/modules/app_banner/BeforeInstallPromptEvent.h

Issue 942913002: [AppBanner] Blink implementation of an event when an install banner is shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/app_banner/BeforeInstallPromptEvent.h
diff --git a/Source/modules/app_banner/BeforeInstallPromptEvent.h b/Source/modules/app_banner/BeforeInstallPromptEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..23160ddde8b667d27b8923db7beb9e04c1a6cd23
--- /dev/null
+++ b/Source/modules/app_banner/BeforeInstallPromptEvent.h
@@ -0,0 +1,53 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BeforeInstallPromptEvent_h
+#define BeforeInstallPromptEvent_h
+
+#include "modules/EventModules.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class BeforeInstallPromptEventInit;
+
+class BeforeInstallPromptEvent final : public Event {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ virtual ~BeforeInstallPromptEvent();
+
+ // For EventModules.cpp
+ static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create()
+ {
+ return adoptRefWillBeNoop(new BeforeInstallPromptEvent());
+ }
+
+ static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicString& name, const String& platform)
+ {
+ return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, platform));
+ }
+
+ static PassRefPtrWillBeRawPtr<BeforeInstallPromptEvent> create(const AtomicString& name, const BeforeInstallPromptEventInit& init)
+ {
+ return adoptRefWillBeNoop(new BeforeInstallPromptEvent(name, init));
+ }
+
+ String platform() const;
+ ScriptPromise userChoice(ScriptState*) const;
+
+ virtual const AtomicString& interfaceName() const override;
+
+private:
+ BeforeInstallPromptEvent();
+ BeforeInstallPromptEvent(const AtomicString& name, const String& platform);
+ BeforeInstallPromptEvent(const AtomicString& name, const BeforeInstallPromptEventInit&);
+
+ String m_platform;
+};
+
+DEFINE_TYPE_CASTS(BeforeInstallPromptEvent, Event, event, event->interfaceName() == EventNames::BeforeInstallPromptEvent, event.interfaceName() == EventNames::BeforeInstallPromptEvent);
+
+} // namespace blink
+
+#endif // BeforeInstallPromptEvent_h

Powered by Google App Engine
This is Rietveld 408576698