| // Copyright 2019 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. |
| |
| #ifndef COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_COMMON_CONTEXTUAL_SEARCH_JS_API_SERVICE_MOJOM_BLINK_TEST_UTILS_H_ |
| #define COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_COMMON_CONTEXTUAL_SEARCH_JS_API_SERVICE_MOJOM_BLINK_TEST_UTILS_H_ |
| |
| #include "components/contextual_search/content/common/contextual_search_js_api_service.mojom-blink.h" |
| |
| |
| namespace contextual_search { |
| namespace mojom { |
| namespace blink { |
| |
| |
| class ContextualSearchJsApiServiceInterceptorForTesting : public ContextualSearchJsApiService { |
| virtual ContextualSearchJsApiService* GetForwardingInterface() = 0; |
| void ShouldEnableJsApi(const ::blink::KURL& url, ShouldEnableJsApiCallback callback) override; |
| void HandleSetCaption(const WTF::String& message, bool does_answer) override; |
| void HandleChangeOverlayPosition(OverlayPosition desired_position) override; |
| }; |
| class ContextualSearchJsApiServiceAsyncWaiter { |
| public: |
| explicit ContextualSearchJsApiServiceAsyncWaiter(ContextualSearchJsApiService* proxy); |
| ~ContextualSearchJsApiServiceAsyncWaiter(); |
| void ShouldEnableJsApi( |
| const ::blink::KURL& url, bool* out_should_enable); |
| |
| private: |
| ContextualSearchJsApiService* const proxy_; |
| |
| DISALLOW_COPY_AND_ASSIGN(ContextualSearchJsApiServiceAsyncWaiter); |
| }; |
| |
| |
| |
| |
| } // namespace blink |
| } // namespace mojom |
| } // namespace contextual_search |
| |
| #endif // COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_COMMON_CONTEXTUAL_SEARCH_JS_API_SERVICE_MOJOM_BLINK_TEST_UTILS_H_ |