| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/contextual_search/browser/contextual_search_js_api_service_
impl.h" | 5 #include "components/contextual_search/browser/contextual_search_js_api_service_
impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "components/contextual_search/browser/contextual_search_js_api_handler.
h" | 10 #include "components/contextual_search/browser/contextual_search_js_api_handler.
h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 | 12 |
| 13 namespace contextual_search { | 13 namespace contextual_search { |
| 14 | 14 |
| 15 ContextualSearchJsApiServiceImpl::ContextualSearchJsApiServiceImpl( | 15 ContextualSearchJsApiServiceImpl::ContextualSearchJsApiServiceImpl( |
| 16 ContextualSearchJsApiHandler* contextual_search_js_api_handler) | 16 ContextualSearchJsApiHandler* contextual_search_js_api_handler) |
| 17 : contextual_search_js_api_handler_(contextual_search_js_api_handler) {} | 17 : contextual_search_js_api_handler_(contextual_search_js_api_handler) {} |
| 18 | 18 |
| 19 ContextualSearchJsApiServiceImpl::~ContextualSearchJsApiServiceImpl() {} | 19 ContextualSearchJsApiServiceImpl::~ContextualSearchJsApiServiceImpl() {} |
| 20 | 20 |
| 21 void ContextualSearchJsApiServiceImpl::HandleSetCaption( | 21 void ContextualSearchJsApiServiceImpl::HandleSetCaption( |
| 22 const std::string& caption, | 22 const std::string& caption, |
| 23 bool does_answer) { | 23 bool does_answer) { |
| 24 contextual_search_js_api_handler_->SetCaption(caption, does_answer); | 24 contextual_search_js_api_handler_->SetCaption(caption, does_answer); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 void CreateContextualSearchJsApiService( | 28 void CreateContextualSearchJsApiService( |
| 29 ContextualSearchJsApiHandler* contextual_search_js_api_handler, | 29 ContextualSearchJsApiHandler* contextual_search_js_api_handler, |
| 30 mojo::InterfaceRequest<mojom::ContextualSearchJsApiService> request) { | 30 const service_manager::BindSourceInfo& source_info, |
| 31 mojom::ContextualSearchJsApiServiceRequest request) { |
| 31 mojo::MakeStrongBinding(base::MakeUnique<ContextualSearchJsApiServiceImpl>( | 32 mojo::MakeStrongBinding(base::MakeUnique<ContextualSearchJsApiServiceImpl>( |
| 32 contextual_search_js_api_handler), | 33 contextual_search_js_api_handler), |
| 33 std::move(request)); | 34 std::move(request)); |
| 34 } | 35 } |
| 35 | 36 |
| 36 } // namespace contextual_search | 37 } // namespace contextual_search |
| OLD | NEW |