| 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
|
|
|