| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 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 /* | |
| 6 ExternalJSObject class: | |
| 7 Bound to a JavaScript window.external object using | |
| 8 CppBoundClass::BindToJavascript(), this adds methods accessible from JS for | |
| 9 compatibility with other browsers. | |
| 10 */ | |
| 11 | |
| 12 #ifndef CHROME_RENDERER_EXTERNAL_JS_OBJECT_H__ | |
| 13 #define CHROME_RENDERER_EXTERNAL_JS_OBJECT_H__ | |
| 14 | |
| 15 #include "base/basictypes.h" | |
| 16 #include "webkit/glue/cpp_bound_class.h" | |
| 17 | |
| 18 class RenderView; | |
| 19 | |
| 20 class ExternalJSObject : public CppBoundClass { | |
| 21 public: | |
| 22 // Builds the property and method lists needed to bind this class to a JS | |
| 23 // object. | |
| 24 ExternalJSObject(); | |
| 25 | |
| 26 // A RenderView must be set before AddSearchProvider is called, or the call | |
| 27 // will do nothing. | |
| 28 void set_render_view(RenderView* rv) { render_view_ = rv; } | |
| 29 | |
| 30 // Given a URL to an OpenSearch document in the first argument, adds the | |
| 31 // corresponding search provider as a keyword search. The nonstandard | |
| 32 // capitalization is for compatibility with Firefox and IE. | |
| 33 void AddSearchProvider(const CppArgumentList& args, CppVariant* result); | |
| 34 | |
| 35 private: | |
| 36 RenderView* render_view_; | |
| 37 | |
| 38 DISALLOW_EVIL_CONSTRUCTORS(ExternalJSObject); | |
| 39 }; | |
| 40 | |
| 41 #endif // CHROME_RENDERER_EXTERNAL_JS_OBJECT_H__ | |
| OLD | NEW |