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

Unified Diff: chrome/renderer/contextualsearch/contextual_search_wrapper.h

Issue 1385663002: [Contextual Search] Add Mojo-enabled API component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Pedro's comments on naming methods in ContextualSearchApiController. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/contextualsearch/contextual_search_wrapper.h
diff --git a/chrome/renderer/contextualsearch/contextual_search_wrapper.h b/chrome/renderer/contextualsearch/contextual_search_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1a9951f2de4141b383bcdbea78e477908a4a3d8
--- /dev/null
+++ b/chrome/renderer/contextualsearch/contextual_search_wrapper.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_WRAPPER_H_
+#define CHROME_RENDERER_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_WRAPPER_H_
+
+#include "base/basictypes.h"
+#include "gin/wrappable.h"
+
+namespace blink {
+class WebFrame;
+}
+
+namespace gin {
+class Arguments;
+}
+
+namespace search {
+
+// Wrapper for injecting Contextual Search JavaScript
+// into a WebFrame.
+class ContextualSearchWrapper : public gin::Wrappable<ContextualSearchWrapper> {
+ public:
+ // Installs Contextual Search JavaScript.
+ static void Install(blink::WebFrame* frame);
+
+ // Required by gin::Wrappable.
+ static gin::WrapperInfo kWrapperInfo;
+
+ private:
+ // Intantiate by calling Install.
+ ContextualSearchWrapper();
+ ~ContextualSearchWrapper() override;
+
+ // gin::Wrappable.
+ gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
+ v8::Isolate* isolate) final;
+
+ // Called by JavaScript to set the caption.
+ void SetCaption(const std::string& caption);
+
+ DISALLOW_COPY_AND_ASSIGN(ContextualSearchWrapper);
+};
+
+} // namespace search
+
+#endif // CHROME_RENDERER_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698