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

Unified Diff: Source/modules/app_banner/AppBannerController.cpp

Issue 1257823003: Revert of Refactor BeforeInstallPromptEvent to use ScriptPromiseProperty (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « Source/modules/app_banner/AppBannerCallbacks.cpp ('k') | Source/modules/app_banner/AppBannerPromptResult.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/app_banner/AppBannerController.cpp
diff --git a/Source/modules/app_banner/AppBannerController.cpp b/Source/modules/app_banner/AppBannerController.cpp
index 47af8985a0a765ee29cc6c2481d8c5defb0b4c8f..af8b67f11f5c43cf8ccff7711fa76374464bbd6b 100644
--- a/Source/modules/app_banner/AppBannerController.cpp
+++ b/Source/modules/app_banner/AppBannerController.cpp
@@ -6,14 +6,11 @@
#include "modules/app_banner/AppBannerController.h"
#include "core/EventTypeNames.h"
-#include "core/dom/Document.h"
#include "core/frame/DOMWindow.h"
#include "core/frame/LocalFrame.h"
-#include "modules/app_banner/AppBannerCallbacks.h"
#include "modules/app_banner/BeforeInstallPromptEvent.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "public/platform/WebVector.h"
-#include "public/platform/modules/app_banner/WebAppBannerClient.h"
#include "public/platform/modules/app_banner/WebAppBannerPromptReply.h"
namespace blink {
@@ -27,13 +24,9 @@
for (const WebString& platform : platforms)
wtfPlatforms.append(platform);
- RefPtrWillBeRawPtr<BeforeInstallPromptEvent> event = BeforeInstallPromptEvent::create(EventTypeNames::beforeinstallprompt, frame->document(), wtfPlatforms, requestId, client);
- WebAppBannerCallbacks* callbacks = new AppBannerCallbacks(event->userChoiceProperty());
- client->registerBannerCallbacks(requestId, callbacks);
-
// dispatchEvent() returns whether the default behavior can happen. In other
// words, it returns false if preventDefault() was called.
- *reply = frame->domWindow()->dispatchEvent(event)
+ *reply = frame->domWindow()->dispatchEvent(BeforeInstallPromptEvent::create(EventTypeNames::beforeinstallprompt, wtfPlatforms, requestId, client))
? WebAppBannerPromptReply::None : WebAppBannerPromptReply::Cancel;
}
« no previous file with comments | « Source/modules/app_banner/AppBannerCallbacks.cpp ('k') | Source/modules/app_banner/AppBannerPromptResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698