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: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | interface nsIWebBrowser; |
michael@0 | 10 | interface nsIDocShellTreeItem; |
michael@0 | 11 | |
michael@0 | 12 | /** |
michael@0 | 13 | * nsIWebBrowserChrome corresponds to the top-level, outermost window |
michael@0 | 14 | * containing an embedded Gecko web browser. |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | [scriptable, uuid(E8C414C4-DC38-4BA3-AB4E-EC4CBBE22907)] |
michael@0 | 18 | interface nsIWebBrowserChrome : nsISupports |
michael@0 | 19 | { |
michael@0 | 20 | const unsigned long STATUS_SCRIPT = 0x00000001; |
michael@0 | 21 | const unsigned long STATUS_LINK = 0x00000003; |
michael@0 | 22 | |
michael@0 | 23 | /** |
michael@0 | 24 | * Called when the status text in the chrome needs to be updated. |
michael@0 | 25 | * @param statusType indicates what is setting the text |
michael@0 | 26 | * @param status status string. null is an acceptable value meaning |
michael@0 | 27 | * no status. |
michael@0 | 28 | */ |
michael@0 | 29 | void setStatus(in unsigned long statusType, in wstring status); |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * The currently loaded WebBrowser. The browser chrome may be |
michael@0 | 33 | * told to set the WebBrowser object to a new object by setting this |
michael@0 | 34 | * attribute. In this case the implementer is responsible for taking the |
michael@0 | 35 | * new WebBrowser object and doing any necessary initialization or setup |
michael@0 | 36 | * as if it had created the WebBrowser itself. This includes positioning |
michael@0 | 37 | * setting up listeners etc. |
michael@0 | 38 | */ |
michael@0 | 39 | attribute nsIWebBrowser webBrowser; |
michael@0 | 40 | |
michael@0 | 41 | /** |
michael@0 | 42 | * Definitions for the chrome flags |
michael@0 | 43 | */ |
michael@0 | 44 | const unsigned long CHROME_DEFAULT = 0x00000001; |
michael@0 | 45 | const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; |
michael@0 | 46 | const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; |
michael@0 | 47 | const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; |
michael@0 | 48 | const unsigned long CHROME_MENUBAR = 0x00000010; |
michael@0 | 49 | const unsigned long CHROME_TOOLBAR = 0x00000020; |
michael@0 | 50 | const unsigned long CHROME_LOCATIONBAR = 0x00000040; |
michael@0 | 51 | const unsigned long CHROME_STATUSBAR = 0x00000080; |
michael@0 | 52 | const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; |
michael@0 | 53 | const unsigned long CHROME_SCROLLBARS = 0x00000200; |
michael@0 | 54 | const unsigned long CHROME_TITLEBAR = 0x00000400; |
michael@0 | 55 | const unsigned long CHROME_EXTRA = 0x00000800; |
michael@0 | 56 | |
michael@0 | 57 | // createBrowserWindow specific flags |
michael@0 | 58 | const unsigned long CHROME_WITH_SIZE = 0x00001000; |
michael@0 | 59 | const unsigned long CHROME_WITH_POSITION = 0x00002000; |
michael@0 | 60 | |
michael@0 | 61 | // special cases |
michael@0 | 62 | const unsigned long CHROME_WINDOW_MIN = 0x00004000; |
michael@0 | 63 | const unsigned long CHROME_WINDOW_POPUP = 0x00008000; |
michael@0 | 64 | |
michael@0 | 65 | // whether to open a new private window. CHROME_NON_PRIVATE_WINDOW |
michael@0 | 66 | // forces the opened window to be non-private, and overrides |
michael@0 | 67 | // CHROME_PRIVATE_WINDOW if it's set. CHROME_PRIVATE_WINDOW |
michael@0 | 68 | // forces the opened window to be private. If neither of these |
michael@0 | 69 | // flags are specified, the opened window will inherit the privacy |
michael@0 | 70 | // status of its opener. If there is no opener window, the new |
michael@0 | 71 | // window will be non-private. |
michael@0 | 72 | // |
michael@0 | 73 | // CHROME_PRIVATE_LIFETIME causes the docshell to affect private-browsing |
michael@0 | 74 | // session lifetime. This flag is currently respected only for remote |
michael@0 | 75 | // docshells. |
michael@0 | 76 | const unsigned long CHROME_PRIVATE_WINDOW = 0x00010000; |
michael@0 | 77 | const unsigned long CHROME_NON_PRIVATE_WINDOW = 0x00020000; |
michael@0 | 78 | const unsigned long CHROME_PRIVATE_LIFETIME = 0x00040000; |
michael@0 | 79 | |
michael@0 | 80 | // Whether this was opened by nsGlobalWindow::ShowModalDialog. |
michael@0 | 81 | const unsigned long CHROME_MODAL_CONTENT_WINDOW = 0x00080000; |
michael@0 | 82 | |
michael@0 | 83 | // Whether this window should use remote (out-of-process) tabs. |
michael@0 | 84 | const unsigned long CHROME_REMOTE_WINDOW = 0x00100000; |
michael@0 | 85 | |
michael@0 | 86 | // Prevents new window animations on Mac OS X Lion. Ignored on other |
michael@0 | 87 | // platforms. |
michael@0 | 88 | const unsigned long CHROME_MAC_SUPPRESS_ANIMATION = 0x01000000; |
michael@0 | 89 | |
michael@0 | 90 | const unsigned long CHROME_WINDOW_RAISED = 0x02000000; |
michael@0 | 91 | const unsigned long CHROME_WINDOW_LOWERED = 0x04000000; |
michael@0 | 92 | const unsigned long CHROME_CENTER_SCREEN = 0x08000000; |
michael@0 | 93 | |
michael@0 | 94 | // Make the new window dependent on the parent. This flag is only |
michael@0 | 95 | // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be |
michael@0 | 96 | // dependent. |
michael@0 | 97 | const unsigned long CHROME_DEPENDENT = 0x10000000; |
michael@0 | 98 | |
michael@0 | 99 | // Note: The modal style bit just affects the way the window looks and does |
michael@0 | 100 | // mean it's actually modal. |
michael@0 | 101 | const unsigned long CHROME_MODAL = 0x20000000; |
michael@0 | 102 | const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; |
michael@0 | 103 | const unsigned long CHROME_OPENAS_CHROME = 0x80000000; |
michael@0 | 104 | |
michael@0 | 105 | const unsigned long CHROME_ALL = 0x00000ffe; |
michael@0 | 106 | |
michael@0 | 107 | /** |
michael@0 | 108 | * The chrome flags for this browser chrome. The implementation should |
michael@0 | 109 | * reflect the value of this attribute by hiding or showing its chrome |
michael@0 | 110 | * appropriately. |
michael@0 | 111 | */ |
michael@0 | 112 | attribute unsigned long chromeFlags; |
michael@0 | 113 | |
michael@0 | 114 | /** |
michael@0 | 115 | * Asks the implementer to destroy the window associated with this |
michael@0 | 116 | * WebBrowser object. |
michael@0 | 117 | */ |
michael@0 | 118 | void destroyBrowserWindow(); |
michael@0 | 119 | |
michael@0 | 120 | /** |
michael@0 | 121 | * Tells the chrome to size itself such that the browser will be the |
michael@0 | 122 | * specified size. |
michael@0 | 123 | * @param aCX new width of the browser |
michael@0 | 124 | * @param aCY new height of the browser |
michael@0 | 125 | */ |
michael@0 | 126 | void sizeBrowserTo(in long aCX, in long aCY); |
michael@0 | 127 | |
michael@0 | 128 | /** |
michael@0 | 129 | * Shows the window as a modal window. |
michael@0 | 130 | * @return (the function error code) the status value specified by |
michael@0 | 131 | * in exitModalEventLoop. |
michael@0 | 132 | */ |
michael@0 | 133 | void showAsModal(); |
michael@0 | 134 | |
michael@0 | 135 | /** |
michael@0 | 136 | * Is the window modal (that is, currently executing a modal loop)? |
michael@0 | 137 | * @return true if it's a modal window |
michael@0 | 138 | */ |
michael@0 | 139 | boolean isWindowModal(); |
michael@0 | 140 | |
michael@0 | 141 | /** |
michael@0 | 142 | * Exit a modal event loop if we're in one. The implementation |
michael@0 | 143 | * should also exit out of the loop if the window is destroyed. |
michael@0 | 144 | * @param aStatus - the result code to return from showAsModal |
michael@0 | 145 | */ |
michael@0 | 146 | void exitModalEventLoop(in nsresult aStatus); |
michael@0 | 147 | }; |
michael@0 | 148 |