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

Side by Side Diff: components/contextual_search/browser/contextual_search_js_api_service_impl.h

Issue 1532743002: [Contextual Search] Use Mojo API for Quick Answers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated a comment. Created 4 years, 11 months 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 unified diff | Download patch
OLDNEW
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 #ifndef COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IM PL_H_ 5 #ifndef COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IM PL_H_
6 #define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IM PL_H_ 6 #define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IM PL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/contextual_search/browser/contextual_search_ui_handle.h" 9 #include "components/contextual_search/browser/contextual_search_js_api_handler. h"
10 #include "components/contextual_search/common/contextual_search_js_api_service.m ojom.h" 10 #include "components/contextual_search/common/contextual_search_js_api_service.m ojom.h"
11 #include "mojo/public/cpp/bindings/string.h" 11 #include "mojo/public/cpp/bindings/string.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h" 12 #include "mojo/public/cpp/bindings/strong_binding.h"
13 13
14 namespace contextual_search { 14 namespace contextual_search {
15 15
16 // This is the receiving end of Contextual Search JavaScript API calls. 16 // This is the receiving end of Contextual Search JavaScript API calls.
17 class ContextualSearchJsApiServiceImpl : public ContextualSearchJsApiService { 17 class ContextualSearchJsApiServiceImpl : public ContextualSearchJsApiService {
18 public: 18 public:
19 ContextualSearchJsApiServiceImpl( 19 ContextualSearchJsApiServiceImpl(
20 ContextualSearchUIHandle* contextual_search_ui_handle, 20 ContextualSearchJsApiHandler* contextual_search_js_api_handler,
21 mojo::InterfaceRequest<ContextualSearchJsApiService> request); 21 mojo::InterfaceRequest<ContextualSearchJsApiService> request);
22 ~ContextualSearchJsApiServiceImpl() override; 22 ~ContextualSearchJsApiServiceImpl() override;
23 23
24 // Mojo ContextualSearchApiService implementation. 24 // Mojo ContextualSearchApiService implementation.
25 void HandleSetCaption(const mojo::String& message, bool does_answer) override; 25 void HandleSetCaption(const mojo::String& message, bool does_answer) override;
26 26
27 private: 27 private:
28 mojo::StrongBinding<ContextualSearchJsApiService> binding_; 28 mojo::StrongBinding<ContextualSearchJsApiService> binding_;
29 29
30 // The UI that handles calls through this API. 30 // The UI handler for calls through the JavaScript API.
31 ContextualSearchUIHandle* contextual_search_ui_handle_; 31 ContextualSearchJsApiHandler* contextual_search_js_api_handler_;
32 32
33 DISALLOW_COPY_AND_ASSIGN(ContextualSearchJsApiServiceImpl); 33 DISALLOW_COPY_AND_ASSIGN(ContextualSearchJsApiServiceImpl);
34 }; 34 };
35 35
36 // static 36 // static
37 void CreateContextualSearchJsApiService( 37 void CreateContextualSearchJsApiService(
38 ContextualSearchUIHandle* contextual_search_ui_handle, 38 ContextualSearchJsApiHandler* contextual_search_js_api_handler,
39 mojo::InterfaceRequest<ContextualSearchJsApiService> request); 39 mojo::InterfaceRequest<ContextualSearchJsApiService> request);
40 40
41 } // namespace contextual_search 41 } // namespace contextual_search
42 42
43 #endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE _IMPL_H_ 43 #endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE _IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698