| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/test_runner/app_banner_service.h" |
| 6 |
| 7 namespace test_runner { |
| 8 |
| 9 AppBannerService::AppBannerService(int request_id) : request_id_(request_id) {} |
| 10 |
| 11 AppBannerService::~AppBannerService() {} |
| 12 |
| 13 void AppBannerService::BindHandle(mojo::ScopedMessagePipeHandle handle) { |
| 14 binding_.reset(new mojo::Binding<blink::mojom::AppBannerService>( |
| 15 this, |
| 16 mojo::MakeRequest<blink::mojom::AppBannerService>(std::move(handle)))); |
| 17 } |
| 18 |
| 19 void AppBannerService::ResolvePromise(int request_id, |
| 20 const std::string& platform) { |
| 21 if (request_id != request_id_) |
| 22 return; |
| 23 |
| 24 // Empty platform means to resolve as a dismissal. |
| 25 if (platform.empty()) |
| 26 (*event_)->BannerDismissed(request_id); |
| 27 else |
| 28 (*event_)->BannerAccepted(request_id, platform); |
| 29 } |
| 30 |
| 31 void AppBannerService::DisplayAppBanner(int request_id) {} |
| 32 |
| 33 void AppBannerService::SetEvent(blink::mojom::AppBannerEventPtr event) { |
| 34 event_.reset(new blink::mojom::AppBannerEventPtr(std::move(event))); |
| 35 } |
| 36 |
| 37 } // namespace test_runner |
| OLD | NEW |