| 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 <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/callback_forward.h" |
| 12 #include "base/macros.h" |
| 13 #include "components/test_runner/test_runner_export.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "third_party/WebKit/public/platform/modules/app_banner/app_banner.mojom
.h" |
| 16 |
| 17 namespace test_runner { |
| 18 |
| 19 // Test app banner service that is registered as a Mojo service for |
| 20 // BeforeInstallPromptEvents to look up when the test runner is executed. |
| 21 class TEST_RUNNER_EXPORT AppBannerService |
| 22 : public NON_EXPORTED_BASE(blink::mojom::AppBannerService) { |
| 23 public: |
| 24 AppBannerService(); |
| 25 ~AppBannerService() override; |
| 26 |
| 27 blink::mojom::AppBannerControllerPtr& controller() { return controller_; } |
| 28 void ResolvePromise(const std::string& platform); |
| 29 void SendBannerPromptRequest(const std::vector<std::string>& platforms, |
| 30 const base::Callback<void(bool)>& callback); |
| 31 |
| 32 // blink::mojom::AppBannerService overrides. |
| 33 void DisplayAppBanner() override; |
| 34 |
| 35 private: |
| 36 void OnBannerPromptReply(const base::Callback<void(bool)>& callback, |
| 37 blink::mojom::AppBannerPromptReply, |
| 38 const std::string& referrer); |
| 39 |
| 40 mojo::Binding<blink::mojom::AppBannerService> binding_; |
| 41 blink::mojom::AppBannerEventPtr event_; |
| 42 blink::mojom::AppBannerControllerPtr controller_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(AppBannerService); |
| 45 }; |
| 46 |
| 47 } // namespace test_runner |
| 48 |
| 49 #endif // COMPONENTS_TEST_RUNNER_APP_BANNER_SERVICE_H_ |
| OLD | NEW |