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

Unified Diff: components/contextual_search/browser/contextual_search_js_api_service_impl.cc

Issue 1385663002: [Contextual Search] Add Mojo-enabled API component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a few more missing dependencies to the new component's BUILD.gn rules for our renderer sectio… Created 5 years 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/browser/contextual_search_js_api_service_impl.cc
diff --git a/components/contextual_search/browser/contextual_search_js_api_service_impl.cc b/components/contextual_search/browser/contextual_search_js_api_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5aea4835fc36f9c342d27ed0a92a919587c6b358
--- /dev/null
+++ b/components/contextual_search/browser/contextual_search_js_api_service_impl.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "components/contextual_search/browser/contextual_search_js_api_service_impl.h"
+
+#include "components/contextual_search/browser/contextual_search_ui_handle.h"
+
+namespace contextual_search {
+
+ContextualSearchJsApiServiceImpl::ContextualSearchJsApiServiceImpl(
+ ContextualSearchUIHandle* contextual_search_ui_handle,
+ mojo::InterfaceRequest<ContextualSearchJsApiService> request)
+ : binding_(this, request.Pass()),
+ contextual_search_ui_handle_(contextual_search_ui_handle) {}
+
+ContextualSearchJsApiServiceImpl::~ContextualSearchJsApiServiceImpl() {}
+
+void ContextualSearchJsApiServiceImpl::HandleSetCaption(
+ const mojo::String& caption,
+ bool does_answer) {
+ contextual_search_ui_handle_->SetCaption(caption, does_answer);
+}
+
+// static
+void CreateContextualSearchJsApiService(
+ ContextualSearchUIHandle* contextual_search_ui_handle,
+ mojo::InterfaceRequest<ContextualSearchJsApiService> request) {
+ // This is strongly bound and owned by the pipe.
+ new ContextualSearchJsApiServiceImpl(contextual_search_ui_handle,
+ request.Pass());
+}
+
+} // namespace contextual_search

Powered by Google App Engine
This is Rietveld 408576698