Chromium Code Reviews| Index: components/contextual_search/contextual_search_api_service_impl.h |
| diff --git a/components/contextual_search/contextual_search_api_service_impl.h b/components/contextual_search/contextual_search_api_service_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7281f6c54b53a9224181d36811f7ff255af3bd88 |
| --- /dev/null |
| +++ b/components/contextual_search/contextual_search_api_service_impl.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2015 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_CONTEXTUAL_SEARCH_API_SERVICE_IMPL_H_ |
| +#define COMPONENTS_CONTEXTUAL_SEARCH_CONTEXTUAL_SEARCH_API_SERVICE_IMPL_H_ |
| + |
| +#include "components/contextual_search/contextual_search_api_service.mojom.h" |
| +#include "components/contextual_search/contextual_search_ui_handle.h" |
| +#include "content/public/browser/render_frame_host.h" |
| +#include "mojo/public/cpp/bindings/string.h" |
| +#include "mojo/public/cpp/bindings/strong_binding.h" |
| + |
| +namespace contextual_search { |
| + |
| +// This is the receiving end of Contextual Search JavaScript API calls. |
| +class ContextualSearchApiServiceImpl : public ContextualSearchApiService { |
| + public: |
| + ContextualSearchApiServiceImpl( |
| + ContextualSearchUIHandle* contextual_search_ui_handle, |
| + mojo::InterfaceRequest<ContextualSearchApiService> request); |
| + ~ContextualSearchApiServiceImpl() override; |
| + |
| + // Mojo ContextualSearchApiService implementation. |
| + |
| + // Handle a call from the JS API to set the caption. |
|
jochen (gone - plz use gerrit)
2015/11/17 14:58:12
that comment belongs on the base class
Donn Denman
2015/11/19 01:11:29
Done.
|
| + void HandleSetCaption(const mojo::String& message) override; |
| + |
| + private: |
| + mojo::StrongBinding<ContextualSearchApiService> binding_; |
| + |
| + // The UI that handles calls through this API. |
| + ContextualSearchUIHandle* contextual_search_ui_handle_; |
| +}; |
|
jochen (gone - plz use gerrit)
2015/11/17 14:58:11
disallow copy/assign for all classes
Donn Denman
2015/11/19 01:11:29
Done for this class and all others in this CL.
|
| + |
| +// static |
| +void CreateContextualSearchApiService( |
| + ContextualSearchUIHandle* contextual_search_ui_handle, |
| + mojo::InterfaceRequest<ContextualSearchApiService> request); |
| + |
| +} // namespace contextual_search |
| + |
| +#endif // COMPONENTS_CONTEXTUAL_SEARCH_CONTEXTUAL_SEARCH_API_SERVICE_IMPL_H_ |