| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifndef WebBindings_h | 31 #ifndef WebBindings_h |
| 32 #define WebBindings_h | 32 #define WebBindings_h |
| 33 | 33 |
| 34 #include <bindings/npruntime.h> | 34 #include <bindings/npruntime.h> |
| 35 #include "WebCommon.h" | 35 #include "WebCommon.h" |
| 36 | 36 |
| 37 namespace WebKit { | 37 namespace WebKit { |
| 38 | 38 |
| 39 class WebDragData; | 39 class WebDragData; |
| 40 class WebRange; |
| 40 | 41 |
| 41 // A haphazard collection of functions for dealing with plugins. | 42 // A haphazard collection of functions for dealing with plugins. |
| 42 class WebBindings { | 43 class WebBindings { |
| 43 public: | 44 public: |
| 44 // NPN Functions ------------------------------------------------------ | 45 // NPN Functions ------------------------------------------------------ |
| 45 // These are all defined in npruntime.h and are well documented. | 46 // These are all defined in npruntime.h and are well documented. |
| 46 | 47 |
| 47 // NPN_Construct | 48 // NPN_Construct |
| 48 WEBKIT_API static bool construct(NPP, NPObject*, const NPVariant* args, uint32_t argCount, NPVariant* result); | 49 WEBKIT_API static bool construct(NPP, NPObject*, const NPVariant* args, uint32_t argCount, NPVariant* result); |
| 49 | 50 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Return true (success) if the given npobj is the current drag event in browser dispatch, | 127 // Return true (success) if the given npobj is the current drag event in browser dispatch, |
| 127 // and is accessible based on context execution frames and their security origins and | 128 // and is accessible based on context execution frames and their security origins and |
| 128 // WebKit clipboard access policy. If so, return the event id and the clipboard data (WebDragData). | 129 // WebKit clipboard access policy. If so, return the event id and the clipboard data (WebDragData). |
| 129 // This only works with V8. If compiled without V8, it'll always return false. | 130 // This only works with V8. If compiled without V8, it'll always return false. |
| 130 WEBKIT_API static bool getDragData(NPObject* event, int* eventId, WebDragData*); | 131 WEBKIT_API static bool getDragData(NPObject* event, int* eventId, WebDragData*); |
| 131 | 132 |
| 132 // Invoke the event access policy checks listed above with GetDragData(). No need for clipboard | 133 // Invoke the event access policy checks listed above with GetDragData(). No need for clipboard |
| 133 // data or event_id outputs, just confirm the given npobj is the current & accessible drag event. | 134 // data or event_id outputs, just confirm the given npobj is the current & accessible drag event. |
| 134 // This only works with V8. If compiled without V8, it'll always return false. | 135 // This only works with V8. If compiled without V8, it'll always return false. |
| 135 WEBKIT_API static bool isDragEvent(NPObject* event); | 136 WEBKIT_API static bool isDragEvent(NPObject* event); |
| 137 |
| 138 // Return true (success) if the given npobj is a range object. |
| 139 // If so, return that range as a WebRange object. |
| 140 WEBKIT_API static bool getRange(NPObject* range, WebRange*); |
| 136 }; | 141 }; |
| 137 | 142 |
| 138 } // namespace WebKit | 143 } // namespace WebKit |
| 139 | 144 |
| 140 #endif | 145 #endif |
| OLD | NEW |