OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 21 matching lines...) Expand all Loading... | |
34 #include "../platform/WebCanvas.h" | 35 #include "../platform/WebCanvas.h" |
35 #include "../platform/WebString.h" | 36 #include "../platform/WebString.h" |
36 #include "../platform/WebURL.h" | 37 #include "../platform/WebURL.h" |
37 #include "WebDragOperation.h" | 38 #include "WebDragOperation.h" |
38 #include "WebDragStatus.h" | 39 #include "WebDragStatus.h" |
39 #include "WebWidget.h" | 40 #include "WebWidget.h" |
40 | 41 |
41 struct NPObject; | 42 struct NPObject; |
42 struct _NPP; | 43 struct _NPP; |
43 | 44 |
45 namespace v8 { | |
46 template <typename T> class Local; | |
47 class Isolate; | |
48 class Object; | |
49 } | |
50 | |
44 namespace blink { | 51 namespace blink { |
45 | 52 |
46 class WebDataSource; | 53 class WebDataSource; |
47 class WebDragData; | 54 class WebDragData; |
48 class WebInputEvent; | 55 class WebInputEvent; |
49 class WebPluginContainer; | 56 class WebPluginContainer; |
50 class WebURLResponse; | 57 class WebURLResponse; |
51 struct WebCompositionUnderline; | 58 struct WebCompositionUnderline; |
52 struct WebCursorInfo; | 59 struct WebCursorInfo; |
53 struct WebPluginParams; | 60 struct WebPluginParams; |
54 struct WebPrintParams; | 61 struct WebPrintParams; |
55 struct WebPoint; | 62 struct WebPoint; |
56 struct WebRect; | 63 struct WebRect; |
57 struct WebTextInputInfo; | 64 struct WebTextInputInfo; |
58 struct WebURLError; | 65 struct WebURLError; |
59 template <typename T> class WebVector; | 66 template <typename T> class WebVector; |
60 | 67 |
61 class WebPlugin { | 68 class WebPlugin { |
62 public: | 69 public: |
63 virtual bool initialize(WebPluginContainer*) = 0; | 70 virtual bool initialize(WebPluginContainer*) = 0; |
64 virtual void destroy() = 0; | 71 virtual void destroy() = 0; |
65 | 72 |
66 virtual WebPluginContainer* container() const { return 0; } | 73 virtual WebPluginContainer* container() const { return 0; } |
67 virtual void containerDidDetachFromParent() { } | 74 virtual void containerDidDetachFromParent() { } |
68 | 75 |
69 virtual NPObject* scriptableObject() = 0; | 76 virtual NPObject* scriptableObject() { return 0; }; |
70 virtual struct _NPP* pluginNPP() { return 0; } | 77 virtual struct _NPP* pluginNPP() { return 0; } |
71 | 78 |
79 // The same as scriptableObject() but allows to expose scriptable interface | |
80 // through plain v8 object instead of NPObject. | |
81 // If you override this function, you must return nullptr in scriptableObjec t() | |
82 virtual bool getScriptableObject(v8::Isolate*, v8::Local<v8::Object>*) { ret urn false; } | |
abarth-chromium
2014/07/29 17:34:22
Why not just return a v8::Handle? Can't we use th
Krzysztof Olczyk
2014/07/30 08:40:31
Done.
| |
83 | |
72 // Returns true if the form submission value is successfully obtained | 84 // Returns true if the form submission value is successfully obtained |
73 // from the plugin. The value would be associated with the name attribute | 85 // from the plugin. The value would be associated with the name attribute |
74 // of the corresponding object element. | 86 // of the corresponding object element. |
75 virtual bool getFormValue(WebString&) { return false; } | 87 virtual bool getFormValue(WebString&) { return false; } |
76 virtual bool supportsKeyboardFocus() const { return false; } | 88 virtual bool supportsKeyboardFocus() const { return false; } |
77 virtual bool supportsEditCommands() const { return false; } | 89 virtual bool supportsEditCommands() const { return false; } |
78 // Returns true if this plugin supports input method, which implements | 90 // Returns true if this plugin supports input method, which implements |
79 // setComposition() and confirmComposition() below. | 91 // setComposition() and confirmComposition() below. |
80 virtual bool supportsInputMethod() const { return false; } | 92 virtual bool supportsInputMethod() const { return false; } |
81 | 93 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 virtual bool isPlaceholder() { return true; } | 183 virtual bool isPlaceholder() { return true; } |
172 virtual bool shouldPersist() const { return false; } | 184 virtual bool shouldPersist() const { return false; } |
173 | 185 |
174 protected: | 186 protected: |
175 ~WebPlugin() { } | 187 ~WebPlugin() { } |
176 }; | 188 }; |
177 | 189 |
178 } // namespace blink | 190 } // namespace blink |
179 | 191 |
180 #endif | 192 #endif |
OLD | NEW |