| 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 #ifndef COMPONENTS_TEST_RUNNER_APP_BANNER_SERVICE_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_APP_BANNER_SERVICE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/test_runner/test_runner_export.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "third_party/WebKit/public/platform/modules/app_banner/app_banner.mojom
.h" |
| 12 |
| 13 namespace test_runner { |
| 14 |
| 15 // Test app banner service that is registered as a Mojo service for |
| 16 // BeforeInstallPromptEvents to look up when the test runner is executed. |
| 17 class TEST_RUNNER_EXPORT AppBannerService |
| 18 : public NON_EXPORTED_BASE(blink::mojom::AppBannerService) { |
| 19 public: |
| 20 AppBannerService(int request_id); |
| 21 ~AppBannerService() override; |
| 22 |
| 23 void BindHandle(mojo::ScopedMessagePipeHandle handle); |
| 24 void ResolvePromise(int request_id, const std::string& platform); |
| 25 |
| 26 // blink::mojom::AppBannerService overrides. |
| 27 void DisplayAppBanner(int request_id) override; |
| 28 void SetEvent(blink::mojom::AppBannerEventPtr event) override; |
| 29 |
| 30 private: |
| 31 int request_id_; |
| 32 |
| 33 std::unique_ptr<mojo::Binding<blink::mojom::AppBannerService>> binding_; |
| 34 |
| 35 // A pointer to the current beforeinstallprompt event (if it exists). |
| 36 std::unique_ptr<blink::mojom::AppBannerEventPtr> event_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(AppBannerService); |
| 39 }; |
| 40 |
| 41 } // namespace test_runner |
| 42 |
| 43 #endif // COMPONENTS_TEST_RUNNER_APP_BANNER_SERVICE_H_ |
| OLD | NEW |