OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CHROME_RENDERER_SEARCHBOX_SEARCHBOX_EXTENSION_H_ | 5 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_EXTENSION_H_ |
6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_EXTENSION_H_ | 6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_EXTENSION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace content { | |
11 class RenderView; | |
12 } | |
13 | |
10 namespace v8 { | 14 namespace v8 { |
11 class Extension; | 15 class Extension; |
12 } | 16 } |
13 | 17 |
14 namespace WebKit { | |
15 class WebFrame; | |
16 } | |
17 | |
18 namespace extensions_v8 { | 18 namespace extensions_v8 { |
19 | 19 |
20 // Reference implementation of the SearchBox API as described in: | 20 // Reference implementation of the SearchBox API as described in: |
21 // http://dev.chromium.org/searchbox | 21 // http://dev.chromium.org/searchbox |
22 class SearchBoxExtension { | 22 class SearchBoxExtension { |
23 public: | 23 public: |
24 // Returns the v8::Extension object handling searchbox bindings. Returns null | 24 // Returns the v8::Extension object handling searchbox bindings. Caller takes |
samarth
2013/03/11 19:03:24
Can you use scoped_ptr instead?
| |
25 // if match-preview is not enabled. Caller takes ownership of returned object. | 25 // ownership of the returned object. |
26 static v8::Extension* Get(); | 26 static v8::Extension* Get(); |
27 | 27 |
28 static void DispatchChange(WebKit::WebFrame* frame); | 28 static bool DetermineInstantSupport(content::RenderView* render_view); |
samarth
2013/03/12 21:31:21
Per offline discussion, we should consider just mo
| |
29 static void DispatchSubmit(WebKit::WebFrame* frame); | 29 static void Change(content::RenderView* render_view); |
30 static void DispatchCancel(WebKit::WebFrame* frame); | 30 static void Submit(content::RenderView* render_view); |
31 static void DispatchResize(WebKit::WebFrame* frame); | 31 static void Blur(content::RenderView* render_view); |
32 | 32 static void PopupBounds(content::RenderView* render_view); |
33 static bool PageSupportsInstant(WebKit::WebFrame* frame); | |
34 | |
35 // Extended API. | |
36 static void DispatchOnWindowReady(WebKit::WebFrame* frame); | |
37 static void DispatchAutocompleteResults(WebKit::WebFrame* frame); | |
38 static void DispatchUpOrDownKeyPress(WebKit::WebFrame* frame, int count); | |
39 static void DispatchEscKeyPress(WebKit::WebFrame* frame); | |
40 static void DispatchKeyCaptureChange(WebKit::WebFrame* frame); | |
41 static void DispatchMarginChange(WebKit::WebFrame* frame); | |
42 static void DispatchThemeChange(WebKit::WebFrame* frame); | |
43 | |
44 // New Tab Page API. | |
45 static void DispatchMostVisitedChanged(WebKit::WebFrame* frame); | |
46 | 33 |
47 private: | 34 private: |
48 DISALLOW_IMPLICIT_CONSTRUCTORS(SearchBoxExtension); | 35 DISALLOW_IMPLICIT_CONSTRUCTORS(SearchBoxExtension); |
49 }; | 36 }; |
50 | 37 |
51 } // namespace extensions_v8 | 38 } // namespace extensions_v8 |
52 | 39 |
53 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_EXTENSION_H_ | 40 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_EXTENSION_H_ |
OLD | NEW |