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 | /** |
michael@0 | 7 | * This is the printing prompt interface which can be used without knowlege of a |
michael@0 | 8 | * parent window. The parentage is hidden by the GetInterface though |
michael@0 | 9 | * which it is gotten. This interface is identical to nsIPintingPromptService |
michael@0 | 10 | * but without the parent nsIDOMWindow parameter. See nsIPrintingPromptService |
michael@0 | 11 | * for all documentation. |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | #include "nsISupports.idl" |
michael@0 | 15 | #include "nsIWebBrowserPrint.idl" |
michael@0 | 16 | #include "nsIWebProgressListener.idl" |
michael@0 | 17 | #include "nsIPrintSettings.idl" |
michael@0 | 18 | #include "nsIPrintProgressParams.idl" |
michael@0 | 19 | #include "nsIObserver.idl" |
michael@0 | 20 | |
michael@0 | 21 | [scriptable, uuid(44E314CA-75B1-4f3d-9553-9B3507912108)] |
michael@0 | 22 | interface nsIPrintingPrompt : nsISupports |
michael@0 | 23 | { |
michael@0 | 24 | /** |
michael@0 | 25 | * This service enables embedders to implement their own Print and Progress Dialogs. |
michael@0 | 26 | * Each platform has a "base" or "basckstop" implementation of the service. The |
michael@0 | 27 | * service is automatically registered at start up. |
michael@0 | 28 | * |
michael@0 | 29 | * Historically, platform toolkits with native dialogs have implemented them in the GFX layer |
michael@0 | 30 | * Usually they were displayed when a new DeviceContextSpec specific to that platform |
michael@0 | 31 | * was created. |
michael@0 | 32 | * |
michael@0 | 33 | * Windows: The GFX layer no longers supports default toolkit behavior for displaying the |
michael@0 | 34 | * native Print Dialog. |
michael@0 | 35 | * If an embedder implemented service returns any error code (other than NS_ERROR_ABORT) |
michael@0 | 36 | * printing will terminate. |
michael@0 | 37 | * |
michael@0 | 38 | * Returning NS_OK assumes that the PrintSettings object was correctly filled in and |
michael@0 | 39 | * if it does not have valid fields for printer name, etc. it may also terminate. |
michael@0 | 40 | * |
michael@0 | 41 | * Defaults for platform service: |
michael@0 | 42 | * showPrintDialog - displays a native dialog |
michael@0 | 43 | * showPageSetup - displays a XUL dialog |
michael@0 | 44 | * showProgress - displays a XUL dialog |
michael@0 | 45 | * showPrinterProperties - n/a |
michael@0 | 46 | * |
michael@0 | 47 | * Summary for Windows Embedders: |
michael@0 | 48 | * Stated once again: There is no "fallback" native platform support in GFX for the |
michael@0 | 49 | * displaying of the native print dialog. The current default implementation for Windows |
michael@0 | 50 | * display a native print dialog but a XUL-based progress dialog. |
michael@0 | 51 | * If you wish to have a native progress dialog on Windows you will have to create and |
michael@0 | 52 | * register your own service. |
michael@0 | 53 | * |
michael@0 | 54 | * Note: The Windows version Mozilla implements this service which is |
michael@0 | 55 | * automatically built and registered for you. You can use it as an example. |
michael@0 | 56 | * It is located at "mozilla/embedding/components/printingui/src/win". That service |
michael@0 | 57 | * is capable of displaying a native print dialog and a XUL progress dialog. |
michael@0 | 58 | * |
michael@0 | 59 | * To fly your own dialog you may: |
michael@0 | 60 | * |
michael@0 | 61 | * 1) Implement this service to display at least the Print Dialog and a Print Progress Dialog |
michael@0 | 62 | * or you may implement just one of the dialogs and pass back NS_ERROR_NOT_IMPLEMENTED |
michael@0 | 63 | * for any of the others. |
michael@0 | 64 | * |
michael@0 | 65 | * 2) For the Print Dialog: |
michael@0 | 66 | * You may stub out this service by having all the methods return NS_ERROR_NOT_IMPLEMENTED. |
michael@0 | 67 | * You can then fly you own dialog and then properly fill in the PrintSettings object |
michael@0 | 68 | * before calling nsIWebBrowserPrint's Print method. If you stub out this service |
michael@0 | 69 | * you MUST set "printSilent" to true, if you do not, Printing will terminate and an |
michael@0 | 70 | * error dialog will be displayed. |
michael@0 | 71 | * |
michael@0 | 72 | * Mac: The GFX layer still supports default toolkit behavior for displaying the Print Dialog. |
michael@0 | 73 | * If an embedder implemented service returns NS_ERROR_NOT_IMPLEMENTED for "showPrintDialog" |
michael@0 | 74 | * The toolkit will display the native print dialog. |
michael@0 | 75 | * |
michael@0 | 76 | * Defaults for platform service: |
michael@0 | 77 | * Mac OS9: showPrintDialog - displays a native dialog |
michael@0 | 78 | * showPageSetup - displays a native dialog |
michael@0 | 79 | * showProgress - displays a XUL dialog |
michael@0 | 80 | * showPrinterProperties - n/a |
michael@0 | 81 | * |
michael@0 | 82 | * Mac OSX: showPrintDialog - displays a native dialog |
michael@0 | 83 | * showPageSetup - displays a native dialog |
michael@0 | 84 | * showProgress - not implemented (provided by OS) |
michael@0 | 85 | * showPrinterProperties - n/a |
michael@0 | 86 | * |
michael@0 | 87 | * GTK: There are no native dialog for GTK. |
michael@0 | 88 | * |
michael@0 | 89 | * Defaults for platform service: |
michael@0 | 90 | * showPrintDialog - displays a XUL dialog |
michael@0 | 91 | * showPageSetup - displays a XUL dialog |
michael@0 | 92 | * showProgress - displays a XUL dialog |
michael@0 | 93 | * showPrinterProperties - displays a XUL dialog |
michael@0 | 94 | * |
michael@0 | 95 | */ |
michael@0 | 96 | |
michael@0 | 97 | |
michael@0 | 98 | /** |
michael@0 | 99 | * Show the Print Dialog |
michael@0 | 100 | * |
michael@0 | 101 | * @param webBrowserPrint - represents the document to be printed |
michael@0 | 102 | * @param printSettings - PrintSettings for print "job" |
michael@0 | 103 | * |
michael@0 | 104 | */ |
michael@0 | 105 | void showPrintDialog(in nsIWebBrowserPrint webBrowserPrint, |
michael@0 | 106 | in nsIPrintSettings printSettings); |
michael@0 | 107 | |
michael@0 | 108 | /** |
michael@0 | 109 | * Shows the print progress dialog |
michael@0 | 110 | * |
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 nsIWebBrowserPrint webBrowserPrint, |
michael@0 | 123 | in nsIPrintSettings printSettings, |
michael@0 | 124 | in nsIObserver openDialogObserver, |
michael@0 | 125 | in boolean isForPrinting, |
michael@0 | 126 | out nsIWebProgressListener webProgressListener, |
michael@0 | 127 | out nsIPrintProgressParams printProgressParams, |
michael@0 | 128 | out boolean notifyOnOpen); |
michael@0 | 129 | |
michael@0 | 130 | /** |
michael@0 | 131 | * Shows the print progress dialog |
michael@0 | 132 | * |
michael@0 | 133 | * @param printSettings - PrintSettings for page setup (required) |
michael@0 | 134 | * @param aObs - An observer to know if the contents of the Print Settings |
michael@0 | 135 | * object has changed while the dialog is being shown. |
michael@0 | 136 | * For example, some platforms may implement an "Apply" button (not required) |
michael@0 | 137 | */ |
michael@0 | 138 | void showPageSetup(in nsIPrintSettings printSettings, in nsIObserver aObs); |
michael@0 | 139 | |
michael@0 | 140 | /** |
michael@0 | 141 | * Sometimes platforms need to bring up a special properties dialog for showing |
michael@0 | 142 | * print specific properties. Although the PrintSettings has a place to set the |
michael@0 | 143 | * printer name, here is is an argument to be clear as to what printer is being |
michael@0 | 144 | * asked to have the properties set for it. The Printer name in the PS is ignored. |
michael@0 | 145 | * |
michael@0 | 146 | * @param printerName - name of printer (required) |
michael@0 | 147 | * @param printSettings - PrintSettings for page setup (required) |
michael@0 | 148 | */ |
michael@0 | 149 | void showPrinterProperties(in wstring printerName, |
michael@0 | 150 | in nsIPrintSettings printSettings); |
michael@0 | 151 | }; |