Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: components/contextual_search/contextual_search_api_service_impl.h

Issue 1385663002: [Contextual Search] Add Mojo-enabled API component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked to use a new Contextual Search component and Mojo communication, removed CS Manager stuff. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698