OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
3 * | 4 * |
4 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
6 * met: | 7 * met: |
7 * | 8 * |
8 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 11 * * Redistributions in binary form must reproduce the above |
11 * copyright notice, this list of conditions and the following disclaimer | 12 * copyright notice, this list of conditions and the following disclaimer |
12 * in the documentation and/or other materials provided with the | 13 * in the documentation and/or other materials provided with the |
(...skipping 12 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 30 */ |
30 | 31 |
31 #ifndef WebPluginContainer_h | 32 #ifndef WebPluginContainer_h |
32 #define WebPluginContainer_h | 33 #define WebPluginContainer_h |
33 | 34 |
34 #include "../platform/WebCommon.h" | 35 #include "../platform/WebCommon.h" |
| 36 #include <v8.h> |
35 | 37 |
36 struct NPObject; | 38 struct NPObject; |
37 | 39 |
38 namespace blink { | 40 namespace blink { |
39 | 41 |
40 class WebElement; | 42 class WebElement; |
41 class WebPlugin; | 43 class WebPlugin; |
42 class WebString; | 44 class WebString; |
43 class WebURL; | 45 class WebURL; |
44 class WebURLRequest; | 46 class WebURLRequest; |
(...skipping 28 matching lines...) Expand all Loading... |
73 // Drop any references to script objects allocated by the plugin. | 75 // Drop any references to script objects allocated by the plugin. |
74 // These are objects derived from WebPlugin::scriptableObject. This is | 76 // These are objects derived from WebPlugin::scriptableObject. This is |
75 // called when the plugin is being destroyed or if it needs to be | 77 // called when the plugin is being destroyed or if it needs to be |
76 // re-initialized. | 78 // re-initialized. |
77 virtual void clearScriptObjects() = 0; | 79 virtual void clearScriptObjects() = 0; |
78 | 80 |
79 // Returns the scriptable object associated with the DOM element | 81 // Returns the scriptable object associated with the DOM element |
80 // containing the plugin. | 82 // containing the plugin. |
81 virtual NPObject* scriptableObjectForElement() = 0; | 83 virtual NPObject* scriptableObjectForElement() = 0; |
82 | 84 |
| 85 // Returns the scriptable object associated with the DOM element |
| 86 // containing the plugin as a native v8 object. |
| 87 virtual v8::Local<v8::Object> v8ObjectForElement() = 0; |
| 88 |
83 // Executes a "javascript:" URL on behalf of the plugin in the context | 89 // Executes a "javascript:" URL on behalf of the plugin in the context |
84 // of the frame containing the plugin. Returns the result of script | 90 // of the frame containing the plugin. Returns the result of script |
85 // execution, if any. | 91 // execution, if any. |
86 virtual WebString executeScriptURL(const WebURL&, bool popupsAllowed) = 0; | 92 virtual WebString executeScriptURL(const WebURL&, bool popupsAllowed) = 0; |
87 | 93 |
88 // Loads an URL in the specified frame (or the frame containing this | 94 // Loads an URL in the specified frame (or the frame containing this |
89 // plugin if target is empty). If notifyNeeded is true, then upon | 95 // plugin if target is empty). If notifyNeeded is true, then upon |
90 // completion, WebPlugin::didFinishLoadingFrameRequest is called if the | 96 // completion, WebPlugin::didFinishLoadingFrameRequest is called if the |
91 // load was successful or WebPlugin::didFailLoadingFrameRequest is | 97 // load was successful or WebPlugin::didFailLoadingFrameRequest is |
92 // called if the load failed. The given notifyData is passed along to | 98 // called if the load failed. The given notifyData is passed along to |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // WebPluginContainer does *not* take ownership. | 134 // WebPluginContainer does *not* take ownership. |
129 virtual void setWebLayer(WebLayer*) = 0; | 135 virtual void setWebLayer(WebLayer*) = 0; |
130 | 136 |
131 protected: | 137 protected: |
132 ~WebPluginContainer() { } | 138 ~WebPluginContainer() { } |
133 }; | 139 }; |
134 | 140 |
135 } // namespace blink | 141 } // namespace blink |
136 | 142 |
137 #endif | 143 #endif |
OLD | NEW |