OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/contextual_search/browser/contextual_search_js_api_service_
impl.h" |
| 6 |
| 7 #include "components/contextual_search/browser/contextual_search_ui_handle.h" |
| 8 |
| 9 namespace contextual_search { |
| 10 |
| 11 ContextualSearchJsApiServiceImpl::ContextualSearchJsApiServiceImpl( |
| 12 ContextualSearchUIHandle* contextual_search_ui_handle, |
| 13 mojo::InterfaceRequest<ContextualSearchJsApiService> request) |
| 14 : binding_(this, request.Pass()), |
| 15 contextual_search_ui_handle_(contextual_search_ui_handle) {} |
| 16 |
| 17 ContextualSearchJsApiServiceImpl::~ContextualSearchJsApiServiceImpl() {} |
| 18 |
| 19 void ContextualSearchJsApiServiceImpl::HandleSetCaption( |
| 20 const mojo::String& caption, |
| 21 bool does_answer) { |
| 22 contextual_search_ui_handle_->SetCaption(caption, does_answer); |
| 23 } |
| 24 |
| 25 // static |
| 26 void CreateContextualSearchJsApiService( |
| 27 ContextualSearchUIHandle* contextual_search_ui_handle, |
| 28 mojo::InterfaceRequest<ContextualSearchJsApiService> request) { |
| 29 // This is strongly bound and owned by the pipe. |
| 30 new ContextualSearchJsApiServiceImpl(contextual_search_ui_handle, |
| 31 request.Pass()); |
| 32 } |
| 33 |
| 34 } // namespace contextual_search |
OLD | NEW |