summaryrefslogtreecommitdiffstats
path: root/third_party/npapi/bindings
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-29 20:38:38 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-29 20:38:38 +0000
commitba6b5cfec256bf3e2050a128289c062effede0d2 (patch)
tree274a882ae1ca7e4c1667813d76f3d9cc0158fc2f /third_party/npapi/bindings
parent894f4a077ae70c658a285377c0f957c0259817d3 (diff)
downloadchromium_src-ba6b5cfec256bf3e2050a128289c062effede0d2.zip
chromium_src-ba6b5cfec256bf3e2050a128289c062effede0d2.tar.gz
chromium_src-ba6b5cfec256bf3e2050a128289c062effede0d2.tar.bz2
Allow quering Pepper plugin for selected text for the context menu. Also take out the ability to access the clipboard since it's not exposed to HTML for security reasons.
Review URL: http://codereview.chromium.org/2841028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/npapi/bindings')
-rw-r--r--third_party/npapi/bindings/npapi_extensions.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/third_party/npapi/bindings/npapi_extensions.h b/third_party/npapi/bindings/npapi_extensions.h
index cbc9e69..ec0eaf9 100644
--- a/third_party/npapi/bindings/npapi_extensions.h
+++ b/third_party/npapi/bindings/npapi_extensions.h
@@ -410,11 +410,6 @@ typedef NPDevice* (*NPAcquireDevicePtr)(
NPP instance,
NPDeviceID device);
-/* Copy UTF-8 string into clipboard */
-typedef void (*NPCopyTextToClipboardPtr)(
- NPP instance,
- const char* content);
-
/* Updates the number of find results for the current search term. If
* there are no matches 0 should be passed in. Only when the plugin has
* finished searching should it pass in the final count with finalResult set to
@@ -711,8 +706,6 @@ typedef NPFontExtensions* (*NPGetFontExtensionsPtr)(
struct NPNExtensions {
/* Device interface acquisition */
NPAcquireDevicePtr acquireDevice;
- /* Clipboard functionality */
- NPCopyTextToClipboardPtr copyTextToClipboard;
/* Find */
NPNumberOfFindResultsChangedPtr numberOfFindResultsChanged;
NPSelectedFindResultChangedPtr selectedFindResultChanged;
@@ -1045,16 +1038,31 @@ typedef NPError (*NPPWidgetPropertyChangedPtr) (
NPWidgetID id,
NPWidgetProperty property);
-/* Tells the plugin to copy the selected text */
-typedef NPError (*NPPCopyPtr) (
- NPP instance);
+/* type of selection */
+typedef enum {
+ NPSelectionTypeAny = 0,
+ NPSelectionTypePlainText = 1,
+ NPSelectionTypeHTML = 2
+} NPSelectionType;
+
+/* Gets the selection. NPERR_GENERIC_ERROR is returned if nothing is selected.
+ * 'type' is both an input and output parameter. The caller can request a
+ * specific type, and if the plugin can't provide it, it will return
+ * NPERR_GENERIC_ERROR. Or the caller can specify NPSelectionTypeAny to let the
+ * plugin pick the best format for the data. The result is returned in a buffer
+ * that's owned by the caller and which is allocated using NPN_MemAlloc. If no
+ * data is available, NPERR_GENERIC_ERROR is returned. */
+typedef NPError (*NPPGetSelectionPtr) (
+ NPP instance,
+ NPSelectionType* type,
+ void** data);
typedef struct _NPPExtensions {
NPPGetPrintExtensionsPtr getPrintExtensions;
NPPGetFindExtensionsPtr getFindExtensions;
NPPZoomPtr zoom;
NPPWidgetPropertyChangedPtr widgetPropertyChanged;
- NPPCopyPtr copy;
+ NPPGetSelectionPtr getSelection;
} NPPExtensions;
#endif /* _NP_EXTENSIONS_H_ */