| 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 17 matching lines...) Expand all Loading... |
| 30 | 31 |
| 31 #ifndef WebPlugin_h | 32 #ifndef WebPlugin_h |
| 32 #define WebPlugin_h | 33 #define WebPlugin_h |
| 33 | 34 |
| 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" |
| 41 #include <v8.h> |
| 40 | 42 |
| 41 struct NPObject; | 43 struct NPObject; |
| 42 struct _NPP; | 44 struct _NPP; |
| 43 | 45 |
| 44 namespace blink { | 46 namespace blink { |
| 45 | 47 |
| 46 class WebDataSource; | 48 class WebDataSource; |
| 47 class WebDragData; | 49 class WebDragData; |
| 48 class WebInputEvent; | 50 class WebInputEvent; |
| 49 class WebPluginContainer; | 51 class WebPluginContainer; |
| 50 class WebURLResponse; | 52 class WebURLResponse; |
| 51 struct WebCompositionUnderline; | 53 struct WebCompositionUnderline; |
| 52 struct WebCursorInfo; | 54 struct WebCursorInfo; |
| 53 struct WebPluginParams; | 55 struct WebPluginParams; |
| 54 struct WebPrintParams; | 56 struct WebPrintParams; |
| 55 struct WebPoint; | 57 struct WebPoint; |
| 56 struct WebRect; | 58 struct WebRect; |
| 57 struct WebTextInputInfo; | 59 struct WebTextInputInfo; |
| 58 struct WebURLError; | 60 struct WebURLError; |
| 59 template <typename T> class WebVector; | 61 template <typename T> class WebVector; |
| 60 | 62 |
| 61 class WebPlugin { | 63 class WebPlugin { |
| 62 public: | 64 public: |
| 63 virtual bool initialize(WebPluginContainer*) = 0; | 65 virtual bool initialize(WebPluginContainer*) = 0; |
| 64 virtual void destroy() = 0; | 66 virtual void destroy() = 0; |
| 65 | 67 |
| 66 virtual WebPluginContainer* container() const { return 0; } | 68 virtual WebPluginContainer* container() const { return 0; } |
| 67 virtual void containerDidDetachFromParent() { } | 69 virtual void containerDidDetachFromParent() { } |
| 68 | 70 |
| 69 virtual NPObject* scriptableObject() = 0; | 71 virtual NPObject* scriptableObject() { return 0; } |
| 70 virtual struct _NPP* pluginNPP() { return 0; } | 72 virtual struct _NPP* pluginNPP() { return 0; } |
| 71 | 73 |
| 74 // The same as scriptableObject() but allows to expose scriptable interface |
| 75 // through plain v8 object instead of NPObject. |
| 76 // If you override this function, you must return nullptr in scriptableObjec
t(). |
| 77 virtual v8::Local<v8::Object> v8ScriptableObject(v8::Isolate*) { return v8::
Local<v8::Object>(); } |
| 78 |
| 72 // Returns true if the form submission value is successfully obtained | 79 // Returns true if the form submission value is successfully obtained |
| 73 // from the plugin. The value would be associated with the name attribute | 80 // from the plugin. The value would be associated with the name attribute |
| 74 // of the corresponding object element. | 81 // of the corresponding object element. |
| 75 virtual bool getFormValue(WebString&) { return false; } | 82 virtual bool getFormValue(WebString&) { return false; } |
| 76 virtual bool supportsKeyboardFocus() const { return false; } | 83 virtual bool supportsKeyboardFocus() const { return false; } |
| 77 virtual bool supportsEditCommands() const { return false; } | 84 virtual bool supportsEditCommands() const { return false; } |
| 78 // Returns true if this plugin supports input method, which implements | 85 // Returns true if this plugin supports input method, which implements |
| 79 // setComposition() and confirmComposition() below. | 86 // setComposition() and confirmComposition() below. |
| 80 virtual bool supportsInputMethod() const { return false; } | 87 virtual bool supportsInputMethod() const { return false; } |
| 81 | 88 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 virtual bool isPlaceholder() { return true; } | 178 virtual bool isPlaceholder() { return true; } |
| 172 virtual bool shouldPersist() const { return false; } | 179 virtual bool shouldPersist() const { return false; } |
| 173 | 180 |
| 174 protected: | 181 protected: |
| 175 ~WebPlugin() { } | 182 ~WebPlugin() { } |
| 176 }; | 183 }; |
| 177 | 184 |
| 178 } // namespace blink | 185 } // namespace blink |
| 179 | 186 |
| 180 #endif | 187 #endif |
| OLD | NEW |