Index: components/contextual_search/browser/contextual_search_api_service_impl.h |
diff --git a/components/contextual_search/browser/contextual_search_api_service_impl.h b/components/contextual_search/browser/contextual_search_api_service_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8372de9e3a767284a5d83d7763175440f39c068e |
--- /dev/null |
+++ b/components/contextual_search/browser/contextual_search_api_service_impl.h |
@@ -0,0 +1,44 @@ |
+// 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_BROWSER_CONTEXTUAL_SEARCH_API_SERVICE_IMPL_H_ |
+#define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_API_SERVICE_IMPL_H_ |
+ |
+#include "base/macros.h" |
+#include "components/contextual_search/browser/contextual_search_ui_handle.h" |
+#include "components/contextual_search/common/contextual_search_api_service.mojom.h" |
+#include "content/public/browser/render_frame_host.h" |
mdjones
2015/11/19 20:31:24
Is this include needed?
Donn Denman
2015/11/20 00:01:41
Done.
|
+#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. |
+ 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_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ContextualSearchApiServiceImpl); |
+}; |
+ |
+// static |
+void CreateContextualSearchApiService( |
+ ContextualSearchUIHandle* contextual_search_ui_handle, |
+ mojo::InterfaceRequest<ContextualSearchApiService> request); |
+ |
+} // namespace contextual_search |
+ |
+#endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_API_SERVICE_IMPL_H_ |