| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXTENSION_H_ | 5 #ifndef CHROME_RENDERER_SEARCHBOX_EXTENSION_H_ |
| 6 #define CHROME_RENDERER_SEARCHBOX_EXTENSION_H_ | 6 #define CHROME_RENDERER_SEARCHBOX_EXTENSION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 class Extension; | 12 class Extension; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace WebKit { | 15 namespace WebKit { |
| 16 class WebFrame; | 16 class WebFrame; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace extensions_v8 { | 19 namespace extensions_v8 { |
| 20 | 20 |
| 21 // Reference implementation of the SearchBox API as described in: | 21 // Reference implementation of the SearchBox API as described in: |
| 22 // http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-October/028818.html | 22 // http://dev.chromium.org/searchbox |
| 23 class SearchBoxExtension { | 23 class SearchBoxExtension { |
| 24 public: | 24 public: |
| 25 // Returns the v8::Extension object handling searchbox bindings. Returns null | 25 // Returns the v8::Extension object handling searchbox bindings. Returns null |
| 26 // if match-preview is not enabled. Caller takes ownership of returned object. | 26 // if match-preview is not enabled. Caller takes ownership of returned object. |
| 27 static v8::Extension* Get(); | 27 static v8::Extension* Get(); |
| 28 | 28 |
| 29 static void DispatchChange(WebKit::WebFrame* frame); | 29 static void DispatchChange(WebKit::WebFrame* frame); |
| 30 static void DispatchSubmit(WebKit::WebFrame* frame); | 30 static void DispatchSubmit(WebKit::WebFrame* frame); |
| 31 static void DispatchCancel(WebKit::WebFrame* frame); | 31 static void DispatchCancel(WebKit::WebFrame* frame); |
| 32 static void DispatchResize(WebKit::WebFrame* frame); | 32 static void DispatchResize(WebKit::WebFrame* frame); |
| 33 | 33 |
| 34 static bool PageSupportsInstant(WebKit::WebFrame* frame); | 34 static bool PageSupportsInstant(WebKit::WebFrame* frame); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(SearchBoxExtension); | 37 DISALLOW_COPY_AND_ASSIGN(SearchBoxExtension); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace extensions_v8 | 40 } // namespace extensions_v8 |
| 41 | 41 |
| 42 #endif // CHROME_RENDERER_SEARCHBOX_EXTENSION_H_ | 42 #endif // CHROME_RENDERER_SEARCHBOX_EXTENSION_H_ |
| OLD | NEW |