Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | interface nsIDOMDragEvent; |
michael@0 | 8 | interface nsIURI; |
michael@0 | 9 | |
michael@0 | 10 | [scriptable, uuid(6B58A5A7-76D0-4E93-AB2E-4DE108683FF8)] |
michael@0 | 11 | interface nsIDroppedLinkHandler : nsISupports |
michael@0 | 12 | { |
michael@0 | 13 | /** |
michael@0 | 14 | * Determines if a link being dragged can be dropped and returns true if so. |
michael@0 | 15 | * aEvent should be a dragenter or dragover event. |
michael@0 | 16 | * |
michael@0 | 17 | * If aAllowSameDocument is false, drops are only allowed if the document |
michael@0 | 18 | * of the source of the drag is different from the destination. This check |
michael@0 | 19 | * includes any parent, sibling and child frames in the same content tree. |
michael@0 | 20 | * If true, the source is not checked. |
michael@0 | 21 | */ |
michael@0 | 22 | boolean canDropLink(in nsIDOMDragEvent aEvent, in boolean aAllowSameDocument); |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * Given a drop event aEvent, determines the link being dragged and returns |
michael@0 | 26 | * it. If a uri is returned the caller can, for instance, load it. If null |
michael@0 | 27 | * is returned, there is no valid link to be dropped. |
michael@0 | 28 | * |
michael@0 | 29 | * A NS_ERROR_DOM_SECURITY_ERR error will be thrown and the event cancelled if |
michael@0 | 30 | * the receiving target should not load the uri for security reasons. This |
michael@0 | 31 | * will occur if any of the following conditions are true: |
michael@0 | 32 | * - the source of the drag initiated a link for dragging that |
michael@0 | 33 | * it itself cannot access. This prevents a source document from tricking |
michael@0 | 34 | * the user into a dragging a chrome url, for example. |
michael@0 | 35 | * - aDisallowInherit is true, and the URI being dropped would inherit the |
michael@0 | 36 | * current document's security context (URI_INHERITS_SECURITY_CONTEXT). |
michael@0 | 37 | * |
michael@0 | 38 | * aName is filled in with the link title if it exists, or an empty string |
michael@0 | 39 | * otherwise. |
michael@0 | 40 | */ |
michael@0 | 41 | AString dropLink(in nsIDOMDragEvent aEvent, out AString aName, |
michael@0 | 42 | [optional] in boolean aDisallowInherit); |
michael@0 | 43 | }; |