| 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/renderer/contextual_search_wrapper.h" | 5 #include "components/contextual_search/renderer/contextual_search_wrapper.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "content/public/renderer/chrome_object_extensions_utils.h" | 8 #include "content/public/renderer/chrome_object_extensions_utils.h" |
| 9 #include "content/public/renderer/render_frame.h" | 9 #include "content/public/renderer/render_frame.h" |
| 10 #include "gin/arguments.h" | 10 #include "gin/arguments.h" |
| 11 #include "gin/object_template_builder.h" | 11 #include "gin/object_template_builder.h" |
| 12 #include "services/shell/public/cpp/interface_provider.h" | 12 #include "services/service_manager/public/cpp/interface_provider.h" |
| 13 #include "third_party/WebKit/public/web/WebFrame.h" | 13 #include "third_party/WebKit/public/web/WebFrame.h" |
| 14 #include "third_party/WebKit/public/web/WebKit.h" | 14 #include "third_party/WebKit/public/web/WebKit.h" |
| 15 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 15 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 16 #include "v8/include/v8.h" | 16 #include "v8/include/v8.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 static const char kContextualSearchObjectName[] = "contextualSearch"; | 20 static const char kContextualSearchObjectName[] = "contextualSearch"; |
| 21 static const char kSetCaptionMethodName[] = "setCaption"; | 21 static const char kSetCaptionMethodName[] = "setCaption"; |
| 22 | 22 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void ContextualSearchWrapper::OnDestruct() {} | 83 void ContextualSearchWrapper::OnDestruct() {} |
| 84 | 84 |
| 85 void ContextualSearchWrapper::SetCaption(const std::string& caption, | 85 void ContextualSearchWrapper::SetCaption(const std::string& caption, |
| 86 bool does_answer) { | 86 bool does_answer) { |
| 87 if (EnsureServiceConnected()) { | 87 if (EnsureServiceConnected()) { |
| 88 contextual_search_js_api_service_->HandleSetCaption(caption, does_answer); | 88 contextual_search_js_api_service_->HandleSetCaption(caption, does_answer); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace contextual_search | 92 } // namespace contextual_search |
| OLD | NEW |