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

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

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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/app_banner/AppBannerController.cpp
diff --git a/Source/modules/app_banner/AppBannerController.cpp b/Source/modules/app_banner/AppBannerController.cpp
index 52324957fbe6da20b8291c1075914d5532f5d58d..02417723cd9fd69dfaccee1f863feb7ce1c712e4 100644
--- a/Source/modules/app_banner/AppBannerController.cpp
+++ b/Source/modules/app_banner/AppBannerController.cpp
@@ -10,18 +10,22 @@
#include "core/frame/LocalFrame.h"
#include "modules/app_banner/BeforeInstallPromptEvent.h"
#include "platform/RuntimeEnabledFeatures.h"
+#include "public/platform/WebVector.h"
#include "public/platform/modules/app_banner/WebAppBannerPromptReply.h"
namespace blink {
// static
-void AppBannerController::willShowInstallBannerPrompt(LocalFrame* frame, const WebString& platform, WebAppBannerPromptReply* reply)
+void AppBannerController::willShowInstallBannerPrompt(LocalFrame* frame, const WebVector<WebString>& platforms, WebAppBannerPromptReply* reply)
{
ASSERT(RuntimeEnabledFeatures::appBannerEnabled());
+ Vector<String> wtfPlatforms;
+ for (const WebString& platform : platforms)
+ wtfPlatforms.append(platform);
// dispatchEvent() returns whether the default behavior can happen. In other
// words, it returns false if preventDefault() was called.
- *reply = frame->domWindow()->dispatchEvent(BeforeInstallPromptEvent::create(EventTypeNames::beforeinstallprompt, platform))
+ *reply = frame->domWindow()->dispatchEvent(BeforeInstallPromptEvent::create(EventTypeNames::beforeinstallprompt, wtfPlatforms))
? WebAppBannerPromptReply::None : WebAppBannerPromptReply::Cancel;
}
« no previous file with comments | « Source/modules/app_banner/AppBannerController.h ('k') | Source/modules/app_banner/BeforeInstallPromptEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698