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: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
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 | /* Doc interface here */ |
michael@0 | 7 | |
michael@0 | 8 | #include "nsISupports.idl" |
michael@0 | 9 | #include "nsIWebBrowserPrint.idl" |
michael@0 | 10 | #include "nsIWebProgressListener.idl" |
michael@0 | 11 | #include "nsIPrintProgressParams.idl" |
michael@0 | 12 | #include "nsIPrintSettings.idl" |
michael@0 | 13 | #include "nsIObserver.idl" |
michael@0 | 14 | |
michael@0 | 15 | interface nsIDOMWindow; |
michael@0 | 16 | |
michael@0 | 17 | [scriptable, uuid(75D1553D-63BF-4b5d-A8F7-E4E4CAC21BA4)] |
michael@0 | 18 | interface nsIPrintingPromptService : nsISupports |
michael@0 | 19 | { |
michael@0 | 20 | /** |
michael@0 | 21 | * This service enables embedders to implement their own Print and Progress Dialogs. |
michael@0 | 22 | * Each platform has a "base" or "basckstop" implementation of the service. The |
michael@0 | 23 | * service is automatically registered at start up. |
michael@0 | 24 | * |
michael@0 | 25 | * Historically, platform toolkits with native dialogs have implemented them in the GFX layer |
michael@0 | 26 | * Usually they were displayed when a new DeviceContextSpec specific to that platform |
michael@0 | 27 | * was created. |
michael@0 | 28 | * |
michael@0 | 29 | * Windows: The GFX layer no longers supports default toolkit behavior for displaying the |
michael@0 | 30 | * native Print Dialog. |
michael@0 | 31 | * If an embedder implemented service returns any error code (other than NS_ERROR_ABORT) |
michael@0 | 32 | * printing will terminate. |
michael@0 | 33 | * |
michael@0 | 34 | * Returning NS_OK assumes that the PrintSettings object was correctly filled in and |
michael@0 | 35 | * if it does not have valid fields for printer name, etc. it may also terminate. |
michael@0 | 36 | * |
michael@0 | 37 | * Defaults for platform service: |
michael@0 | 38 | * showPrintDialog - displays a native dialog |
michael@0 | 39 | * showPageSetup - displays a XUL dialog |
michael@0 | 40 | * showProgress - displays a XUL dialog |
michael@0 | 41 | * showPrinterProperties - n/a |
michael@0 | 42 | * |
michael@0 | 43 | * Summary for Windows Embedders: |
michael@0 | 44 | * Stated once again: There is no "fallback" native platform support in GFX for the |
michael@0 | 45 | * displaying of the native print dialog. The current default implementation for Windows |
michael@0 | 46 | * display a native print dialog but a XUL-based progress dialog. |
michael@0 | 47 | * If you wish to have a native progress dialog on Windows you will have to create and |
michael@0 | 48 | * register your own service. |
michael@0 | 49 | * |
michael@0 | 50 | * Note: The Windows version Mozilla implements this service which is |
michael@0 | 51 | * automatically built and registered for you. You can use it as an example. |
michael@0 | 52 | * It is located at "mozilla/embedding/components/printingui/src/win". That service |
michael@0 | 53 | * is capable of displaying a native print dialog and a XUL progress dialog. |
michael@0 | 54 | * |
michael@0 | 55 | * To fly your own dialog you may: |
michael@0 | 56 | * |
michael@0 | 57 | * 1) Implement this service to display at least the Print Dialog and a Print Progress Dialog |
michael@0 | 58 | * or you may implement just one of the dialogs and pass back NS_ERROR_NOT_IMPLEMENTED |
michael@0 | 59 | * for any of the others. |
michael@0 | 60 | * |
michael@0 | 61 | * 2) For the Print Dialog: |
michael@0 | 62 | * You may stub out this service by having all the methods return NS_ERROR_NOT_IMPLEMENTED. |
michael@0 | 63 | * You can then fly you own dialog and then properly fill in the PrintSettings object |
michael@0 | 64 | * before calling nsIWebBrowserPrint's Print method. If you stub out this service |
michael@0 | 65 | * you MUST set "printSilent" to true, if you do not, Printing will terminate and an |
michael@0 | 66 | * error dialog will be displayed. |
michael@0 | 67 | * |
michael@0 | 68 | * Mac: The GFX layer still supports default toolkit behavior for displaying the Print Dialog. |
michael@0 | 69 | * If an embedder implemented service returns NS_ERROR_NOT_IMPLEMENTED for "showPrintDialog" |
michael@0 | 70 | * The toolkit will display the native print dialog. |
michael@0 | 71 | * |
michael@0 | 72 | * Defaults for platform service: |
michael@0 | 73 | * Mac OS9: showPrintDialog - displays a native dialog |
michael@0 | 74 | * showPageSetup - displays a native dialog |
michael@0 | 75 | * showProgress - displays a XUL dialog |
michael@0 | 76 | * showPrinterProperties - n/a |
michael@0 | 77 | * |
michael@0 | 78 | * Mac OSX: showPrintDialog - displays a native dialog |
michael@0 | 79 | * showPageSetup - displays a native dialog |
michael@0 | 80 | * showProgress - not implemented (provided by OS) |
michael@0 | 81 | * showPrinterProperties - n/a |
michael@0 | 82 | * |
michael@0 | 83 | * GTK: There are no native dialog for GTK. |
michael@0 | 84 | * |
michael@0 | 85 | * Defaults for platform service: |
michael@0 | 86 | * showPrintDialog - displays a XUL dialog |
michael@0 | 87 | * showPageSetup - displays a XUL dialog |
michael@0 | 88 | * showProgress - displays a XUL dialog |
michael@0 | 89 | * showPrinterProperties - displays a XUL dialog |
michael@0 | 90 | * |
michael@0 | 91 | */ |
michael@0 | 92 | |
michael@0 | 93 | |
michael@0 | 94 | |
michael@0 | 95 | /** |
michael@0 | 96 | * Show the Print Dialog |
michael@0 | 97 | * |
michael@0 | 98 | * @param parent - a DOM windows the dialog will be parented to (required) |
michael@0 | 99 | * @param webBrowserPrint - represents the document to be printed (required) |
michael@0 | 100 | * @param printSettings - PrintSettings for print "job" (required) |
michael@0 | 101 | * |
michael@0 | 102 | */ |
michael@0 | 103 | void showPrintDialog(in nsIDOMWindow parent, |
michael@0 | 104 | in nsIWebBrowserPrint webBrowserPrint, |
michael@0 | 105 | in nsIPrintSettings printSettings); |
michael@0 | 106 | |
michael@0 | 107 | /** |
michael@0 | 108 | * Shows the print progress dialog |
michael@0 | 109 | * |
michael@0 | 110 | * @param parent - a DOM windows the dialog will be parented to |
michael@0 | 111 | * @param webBrowserPrint - represents the document to be printed |
michael@0 | 112 | * @param printSettings - PrintSettings for print "job" |
michael@0 | 113 | * @param openDialogObserver - an observer that will be notifed when the dialog is opened |
michael@0 | 114 | * @param isForPrinting - true - for printing, false for print preview |
michael@0 | 115 | * @param webProgressListener - additional listener can be registered for progress notifications |
michael@0 | 116 | * @param printProgressParams - parameter object for passing progress state |
michael@0 | 117 | * @param notifyOnOpen - this indicates that the observer will be notified when the progress |
michael@0 | 118 | * dialog has been opened. If false is returned it means the observer |
michael@0 | 119 | * (usually the caller) shouldn't wait |
michael@0 | 120 | * For Print Preview Progress there is intermediate progress |
michael@0 | 121 | */ |
michael@0 | 122 | void showProgress(in nsIDOMWindow parent, |
michael@0 | 123 | in nsIWebBrowserPrint webBrowserPrint, |
michael@0 | 124 | in nsIPrintSettings printSettings, |
michael@0 | 125 | in nsIObserver openDialogObserver, |
michael@0 | 126 | in boolean isForPrinting, |
michael@0 | 127 | out nsIWebProgressListener webProgressListener, |
michael@0 | 128 | out nsIPrintProgressParams printProgressParams, |
michael@0 | 129 | out boolean notifyOnOpen); |
michael@0 | 130 | |
michael@0 | 131 | /** |
michael@0 | 132 | * Shows the print progress dialog |
michael@0 | 133 | * |
michael@0 | 134 | * @param parent - a DOM windows the dialog will be parented to (required) |
michael@0 | 135 | * @param printSettings - PrintSettings for page setup (required) |
michael@0 | 136 | * @param aObs - An observer to know if the contents of the Print Settings |
michael@0 | 137 | * object has changed while the dialog is being shown. |
michael@0 | 138 | * For example, some platforms may implement an "Apply" button (not required) |
michael@0 | 139 | */ |
michael@0 | 140 | void showPageSetup(in nsIDOMWindow parent, |
michael@0 | 141 | in nsIPrintSettings printSettings, |
michael@0 | 142 | in nsIObserver aObs); |
michael@0 | 143 | |
michael@0 | 144 | /** |
michael@0 | 145 | * Sometimes platforms need to bring up a special properties dialog for showing |
michael@0 | 146 | * print specific properties. Although the PrintSettings has a place to set the |
michael@0 | 147 | * printer name, here is is an argument to be clear as to what printer is being |
michael@0 | 148 | * asked to have the properties set for it. The Printer name in the PS is ignored. |
michael@0 | 149 | * |
michael@0 | 150 | * @param parent - a DOM windows the dialog will be parented to (required) |
michael@0 | 151 | * @param printerName - name of printer (required) |
michael@0 | 152 | * @param printSettings - PrintSettings for page setup (required) |
michael@0 | 153 | */ |
michael@0 | 154 | void showPrinterProperties(in nsIDOMWindow parent, |
michael@0 | 155 | in wstring printerName, |
michael@0 | 156 | in nsIPrintSettings printSettings); |
michael@0 | 157 | |
michael@0 | 158 | }; |
michael@0 | 159 | |
michael@0 | 160 | %{C++ |
michael@0 | 161 | // {260FEDC5-524D-4aa6-9A41-E829F4C78B92} |
michael@0 | 162 | #define NS_PRINTINGPROMPTSERVICE_IID \ |
michael@0 | 163 | {0x260fedc5, 0x524d, 0x4aa6, { 0x9a, 0x41, 0xe8, 0x29, 0xf4, 0xc7, 0x8b, 0x92}} |
michael@0 | 164 | %} |
michael@0 | 165 |