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 #ifndef CHROME_RENDERER_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_WRAPPER_H_ |
| 6 #define CHROME_RENDERER_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_WRAPPER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "gin/wrappable.h" |
| 10 |
| 11 namespace blink { |
| 12 class WebFrame; |
| 13 } |
| 14 |
| 15 namespace gin { |
| 16 class Arguments; |
| 17 } |
| 18 |
| 19 namespace search { |
| 20 |
| 21 // Wrapper for injecting Contextual Search JavaScript |
| 22 // into a WebFrame. |
| 23 class ContextualSearchWrapper : public gin::Wrappable<ContextualSearchWrapper> { |
| 24 public: |
| 25 // Installs Contextual Search JavaScript. |
| 26 static void Install(blink::WebFrame* frame); |
| 27 |
| 28 // Required by gin::Wrappable. |
| 29 static gin::WrapperInfo kWrapperInfo; |
| 30 |
| 31 private: |
| 32 // Intantiate by calling Install. |
| 33 ContextualSearchWrapper(); |
| 34 ~ContextualSearchWrapper() override; |
| 35 |
| 36 // gin::Wrappable. |
| 37 gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
| 38 v8::Isolate* isolate) final; |
| 39 |
| 40 // Called by JavaScript to set the caption. |
| 41 void SetCaption(const std::string& caption); |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(ContextualSearchWrapper); |
| 44 }; |
| 45 |
| 46 } // namespace search |
| 47 |
| 48 #endif // CHROME_RENDERER_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_WRAPPER_H_ |
OLD | NEW |