OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 #ifndef CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_METHOD_BINDING_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_METHOD_BINDING_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "content/common/content_export.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class BrowserPlugin; |
| 16 |
| 17 // A BrowserPluginMethodBinding is an interface that can be implemented to |
| 18 // define a method that can be tied to a BrowserPlugin object. This property |
| 19 // can be added to a particular instance of BrowserPlugin through |
| 20 // BrowserPlugin::AddMethodBinding. |
| 21 class CONTENT_EXPORT BrowserPluginMethodBinding { |
| 22 public: |
| 23 virtual ~BrowserPluginMethodBinding() {} |
| 24 |
| 25 // Returns the name of the method. |
| 26 virtual const std::string& GetName() const = 0; |
| 27 |
| 28 // Returns the number of arguments expected by the method. |
| 29 virtual uint32 GetArgCount() const = 0; |
| 30 |
| 31 // Executes the method on |browser_plugin| with the provided |args|. |
| 32 // The return value is stored in |result|. |
| 33 virtual bool Invoke(const NPVariant* args, NPVariant* result) = 0; |
| 34 }; |
| 35 |
| 36 } // namespace content |
| 37 |
| 38 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_METHOD_BINDING_
H_ |
OLD | NEW |