OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IM
PL_H_ |
| 6 #define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IM
PL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "components/contextual_search/browser/contextual_search_ui_handle.h" |
| 10 #include "components/contextual_search/common/contextual_search_js_api_service.m
ojom.h" |
| 11 #include "mojo/public/cpp/bindings/string.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 |
| 14 namespace contextual_search { |
| 15 |
| 16 // This is the receiving end of Contextual Search JavaScript API calls. |
| 17 class ContextualSearchJsApiServiceImpl : public ContextualSearchJsApiService { |
| 18 public: |
| 19 ContextualSearchJsApiServiceImpl( |
| 20 ContextualSearchUIHandle* contextual_search_ui_handle, |
| 21 mojo::InterfaceRequest<ContextualSearchJsApiService> request); |
| 22 ~ContextualSearchJsApiServiceImpl() override; |
| 23 |
| 24 // Mojo ContextualSearchApiService implementation. |
| 25 void HandleSetCaption(const mojo::String& message, bool does_answer) override; |
| 26 |
| 27 private: |
| 28 mojo::StrongBinding<ContextualSearchJsApiService> binding_; |
| 29 |
| 30 // The UI that handles calls through this API. |
| 31 ContextualSearchUIHandle* contextual_search_ui_handle_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ContextualSearchJsApiServiceImpl); |
| 34 }; |
| 35 |
| 36 // static |
| 37 void CreateContextualSearchJsApiService( |
| 38 ContextualSearchUIHandle* contextual_search_ui_handle, |
| 39 mojo::InterfaceRequest<ContextualSearchJsApiService> request); |
| 40 |
| 41 } // namespace contextual_search |
| 42 |
| 43 #endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE
_IMPL_H_ |
OLD | NEW |