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

Unified Diff: components/test_runner/app_banner_service.cc

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: components/test_runner/app_banner_service.cc
diff --git a/components/test_runner/app_banner_service.cc b/components/test_runner/app_banner_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3192501d0574d870a575503d26343e80a4c3e0e1
--- /dev/null
+++ b/components/test_runner/app_banner_service.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 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.
+
+#include "components/test_runner/app_banner_service.h"
+
+namespace test_runner {
+
+AppBannerService::AppBannerService(int request_id) : request_id_(request_id) {}
+
+AppBannerService::~AppBannerService() {}
+
+void AppBannerService::BindHandle(mojo::ScopedMessagePipeHandle handle) {
+ binding_.reset(new mojo::Binding<blink::mojom::AppBannerService>(
+ this,
+ mojo::MakeRequest<blink::mojom::AppBannerService>(std::move(handle))));
+}
+
+void AppBannerService::ResolvePromise(int request_id,
+ const std::string& platform) {
+ if (request_id != request_id_)
+ return;
+
+ // Empty platform means to resolve as a dismissal.
+ if (platform.empty())
+ (*event_)->BannerDismissed(request_id);
+ else
+ (*event_)->BannerAccepted(request_id, platform);
+}
+
+void AppBannerService::DisplayAppBanner(int request_id) {}
+
+void AppBannerService::SetEvent(blink::mojom::AppBannerEventPtr event) {
+ event_.reset(new blink::mojom::AppBannerEventPtr(std::move(event)));
+}
+
+} // namespace test_runner

Powered by Google App Engine
This is Rietveld 408576698