Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIDOMEvent; |
michael@0 | 9 | interface nsIDOMNode; |
michael@0 | 10 | interface imgIContainer; |
michael@0 | 11 | interface nsIURI; |
michael@0 | 12 | interface nsIContextMenuInfo; |
michael@0 | 13 | |
michael@0 | 14 | /* THIS IS A PUBLIC EMBEDDING API */ |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * nsIContextMenuListener2 |
michael@0 | 18 | * |
michael@0 | 19 | * This is an extended version of nsIContextMenuListener |
michael@0 | 20 | * It provides a helper class, nsIContextMenuInfo, to allow access to |
michael@0 | 21 | * background images as well as various utilities. |
michael@0 | 22 | * |
michael@0 | 23 | * @see nsIContextMenuListener |
michael@0 | 24 | * @see nsIContextMenuInfo |
michael@0 | 25 | */ |
michael@0 | 26 | |
michael@0 | 27 | [scriptable, uuid(7fb719b3-d804-4964-9596-77cf924ee314)] |
michael@0 | 28 | interface nsIContextMenuListener2 : nsISupports |
michael@0 | 29 | { |
michael@0 | 30 | /** Flag. No context. */ |
michael@0 | 31 | const unsigned long CONTEXT_NONE = 0; |
michael@0 | 32 | /** Flag. Context is a link element. */ |
michael@0 | 33 | const unsigned long CONTEXT_LINK = 1; |
michael@0 | 34 | /** Flag. Context is an image element. */ |
michael@0 | 35 | const unsigned long CONTEXT_IMAGE = 2; |
michael@0 | 36 | /** Flag. Context is the whole document. */ |
michael@0 | 37 | const unsigned long CONTEXT_DOCUMENT = 4; |
michael@0 | 38 | /** Flag. Context is a text area element. */ |
michael@0 | 39 | const unsigned long CONTEXT_TEXT = 8; |
michael@0 | 40 | /** Flag. Context is an input element. */ |
michael@0 | 41 | const unsigned long CONTEXT_INPUT = 16; |
michael@0 | 42 | /** Flag. Context is a background image. */ |
michael@0 | 43 | const unsigned long CONTEXT_BACKGROUND_IMAGE = 32; |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Called when the browser receives a context menu event (e.g. user is right-mouse |
michael@0 | 47 | * clicking somewhere on the document). The combination of flags, along with the |
michael@0 | 48 | * attributes of <CODE>aUtils</CODE>, indicate where and what was clicked on. |
michael@0 | 49 | * |
michael@0 | 50 | * The following table describes what context flags and node combinations are |
michael@0 | 51 | * possible. |
michael@0 | 52 | * |
michael@0 | 53 | * aContextFlags aUtils.targetNode |
michael@0 | 54 | * |
michael@0 | 55 | * CONTEXT_LINK <A> |
michael@0 | 56 | * CONTEXT_IMAGE <IMG> |
michael@0 | 57 | * CONTEXT_IMAGE | CONTEXT_LINK <IMG> with <A> as an ancestor |
michael@0 | 58 | * CONTEXT_INPUT <INPUT> |
michael@0 | 59 | * CONTEXT_INPUT | CONTEXT_IMAGE <INPUT> with type=image |
michael@0 | 60 | * CONTEXT_TEXT <TEXTAREA> |
michael@0 | 61 | * CONTEXT_DOCUMENT <HTML> |
michael@0 | 62 | * CONTEXT_BACKGROUND_IMAGE <HTML> with background image |
michael@0 | 63 | * |
michael@0 | 64 | * @param aContextFlags Flags indicating the kind of context. |
michael@0 | 65 | * @param aUtils Context information and helper utilities. |
michael@0 | 66 | * |
michael@0 | 67 | * @see nsIContextMenuInfo |
michael@0 | 68 | */ |
michael@0 | 69 | void onShowContextMenu(in unsigned long aContextFlags, in nsIContextMenuInfo aUtils); |
michael@0 | 70 | }; |
michael@0 | 71 | |
michael@0 | 72 | /** |
michael@0 | 73 | * nsIContextMenuInfo |
michael@0 | 74 | * |
michael@0 | 75 | * A helper object for implementors of nsIContextMenuListener2. |
michael@0 | 76 | */ |
michael@0 | 77 | |
michael@0 | 78 | [scriptable, uuid(2f977d56-5485-11d4-87e2-0010a4e75ef2)] |
michael@0 | 79 | interface nsIContextMenuInfo : nsISupports |
michael@0 | 80 | { |
michael@0 | 81 | /** |
michael@0 | 82 | * The DOM context menu event. |
michael@0 | 83 | */ |
michael@0 | 84 | readonly attribute nsIDOMEvent mouseEvent; |
michael@0 | 85 | |
michael@0 | 86 | /** |
michael@0 | 87 | * The DOM node most relevant to the context. |
michael@0 | 88 | */ |
michael@0 | 89 | readonly attribute nsIDOMNode targetNode; |
michael@0 | 90 | |
michael@0 | 91 | /** |
michael@0 | 92 | * Given the <CODE>CONTEXT_LINK</CODE> flag, <CODE>targetNode</CODE> may not |
michael@0 | 93 | * nescesarily be a link. This returns the anchor from <CODE>targetNode</CODE> |
michael@0 | 94 | * if it has one or that of its nearest ancestor if it does not. |
michael@0 | 95 | */ |
michael@0 | 96 | readonly attribute AString associatedLink; |
michael@0 | 97 | |
michael@0 | 98 | /** |
michael@0 | 99 | * Given the <CODE>CONTEXT_IMAGE</CODE> flag, these methods can be |
michael@0 | 100 | * used in order to get the image for viewing, saving, or for the clipboard. |
michael@0 | 101 | * |
michael@0 | 102 | * @return <CODE>NS_OK</CODE> if successful, otherwise <CODE>NS_ERROR_FAILURE</CODE> if no |
michael@0 | 103 | * image was found, or NS_ERROR_NULL_POINTER if an internal error occurs where we think there |
michael@0 | 104 | * is an image, but for some reason it cannot be returned. |
michael@0 | 105 | */ |
michael@0 | 106 | |
michael@0 | 107 | readonly attribute imgIContainer imageContainer; |
michael@0 | 108 | readonly attribute nsIURI imageSrc; |
michael@0 | 109 | |
michael@0 | 110 | /** |
michael@0 | 111 | * Given the <CODE>CONTEXT_BACKGROUND_IMAGE</CODE> flag, these methods can be |
michael@0 | 112 | * used in order to get the image for viewing, saving, or for the clipboard. |
michael@0 | 113 | * |
michael@0 | 114 | * @return <CODE>NS_OK</CODE> if successful, otherwise <CODE>NS_ERROR_FAILURE</CODE> if no background |
michael@0 | 115 | * image was found, or NS_ERROR_NULL_POINTER if an internal error occurs where we think there is a |
michael@0 | 116 | * background image, but for some reason it cannot be returned. |
michael@0 | 117 | */ |
michael@0 | 118 | |
michael@0 | 119 | readonly attribute imgIContainer backgroundImageContainer; |
michael@0 | 120 | readonly attribute nsIURI backgroundImageSrc; |
michael@0 | 121 | }; |