summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/searchbox_extension.h
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 15:48:39 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 15:48:39 +0000
commitce833284bfd1b0a5db62e0f3c25f48af70ae8784 (patch)
tree641d0e058901b544626b3503ff5ce06da08ba926 /chrome/renderer/searchbox_extension.h
parent26cce058ecd57c1da05a9a95a277da91e9be8f43 (diff)
downloadchromium_src-ce833284bfd1b0a5db62e0f3c25f48af70ae8784.zip
chromium_src-ce833284bfd1b0a5db62e0f3c25f48af70ae8784.tar.gz
chromium_src-ce833284bfd1b0a5db62e0f3c25f48af70ae8784.tar.bz2
Implement new SearchBox API along side existing API.
Add some tests. BUG=none TEST=interactive_ui_tests --gtest_filter=InstantTest.* git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/searchbox_extension.h')
-rw-r--r--chrome/renderer/searchbox_extension.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/chrome/renderer/searchbox_extension.h b/chrome/renderer/searchbox_extension.h
new file mode 100644
index 0000000..61d82b7c
--- /dev/null
+++ b/chrome/renderer/searchbox_extension.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2010 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_SEARCHBOX_EXTENSION_H_
+#define CHROME_RENDERER_SEARCHBOX_EXTENSION_H_
+#pragma once
+
+#include "base/basictypes.h"
+
+namespace v8 {
+class Extension;
+}
+
+namespace WebKit {
+class WebFrame;
+}
+
+namespace extensions_v8 {
+
+// Reference implementation of the SearchBox API as described in:
+// http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-October/028818.html
+class SearchBoxExtension {
+ public:
+ // Returns the v8::Extension object handling searchbox bindings. Returns null
+ // if match-preview is not enabled. Caller takes ownership of returned object.
+ static v8::Extension* Get();
+
+ static void DispatchChange(WebKit::WebFrame* frame);
+ static void DispatchSubmit(WebKit::WebFrame* frame);
+ static void DispatchCancel(WebKit::WebFrame* frame);
+ static void DispatchResize(WebKit::WebFrame* frame);
+
+ static bool PageSupportsInstant(WebKit::WebFrame* frame);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SearchBoxExtension);
+};
+
+} // namespace extensions_v8
+
+#endif // CHROME_RENDERER_SEARCHBOX_EXTENSION_H_