Chromium Code Reviews| Index: third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp |
| diff --git a/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp b/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp |
| index 98efdd2747064feb0e1ea7107f522345c10b4685..f949ff955d214285f935861204b86aa4084aba42 100644 |
| --- a/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp |
| +++ b/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp |
| @@ -5,35 +5,31 @@ |
| #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/BeforeInstallPromptEvent.h" |
| #include "public/platform/WebVector.h" |
| -#include "public/platform/modules/app_banner/WebAppBannerClient.h" |
| -#include "public/platform/modules/app_banner/WebAppBannerPromptReply.h" |
| +#include "third_party/WebKit/public/platform/modules/app_banner/app_banner.mojom-blink.h" |
| namespace blink { |
| // static |
| void AppBannerController::willShowInstallBannerPrompt( |
| - int requestId, |
| - WebAppBannerClient* client, |
| LocalFrame* frame, |
| + int requestId, |
| const WebVector<WebString>& platforms, |
| - WebAppBannerPromptReply* reply) { |
| + mojom::AppBannerPromptReply* reply) { |
|
Sam McNally
2016/10/06 07:17:43
Could the reply be a return value instead?
dominickn
2016/10/06 22:58:12
I'd rather leave it so that it's consistently an o
|
| 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, frame->document(), wtfPlatforms, |
| - requestId, client)) == DispatchEventResult::NotCanceled |
| - ? WebAppBannerPromptReply::None |
| - : WebAppBannerPromptReply::Cancel; |
| + *reply = frame->domWindow()->dispatchEvent(BeforeInstallPromptEvent::create( |
| + EventTypeNames::beforeinstallprompt, frame, requestId, |
| + wtfPlatforms)) == DispatchEventResult::NotCanceled |
| + ? mojom::AppBannerPromptReply::NONE |
| + : mojom::AppBannerPromptReply::CANCEL; |
| } |
| } // namespace blink |