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

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

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Fix Win clang compile Created 4 years, 2 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: 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

Powered by Google App Engine
This is Rietveld 408576698