| 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() : binding_(this) {} |
| 10 |
| 11 AppBannerService::~AppBannerService() {} |
| 12 |
| 13 mojo::ScopedMessagePipeHandle AppBannerService::GetEventHandle() { |
| 14 return mojo::GetProxy(&event_).PassMessagePipe(); |
| 15 } |
| 16 |
| 17 mojo::ScopedMessagePipeHandle AppBannerService::GetServiceHandle() { |
| 18 return binding_.CreateInterfacePtrAndBind().PassInterface().PassHandle(); |
| 19 } |
| 20 |
| 21 void AppBannerService::ResolvePromise(const std::string& platform) { |
| 22 if (!event_.is_bound()) |
| 23 return; |
| 24 |
| 25 // Empty platform means to resolve as a dismissal. |
| 26 if (platform.empty()) |
| 27 event_->BannerDismissed(); |
| 28 else |
| 29 event_->BannerAccepted(platform); |
| 30 } |
| 31 |
| 32 void AppBannerService::DisplayAppBanner() { /* do nothing */ } |
| 33 |
| 34 } // namespace test_runner |
| OLD | NEW |