Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 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 nsIPromptService |
michael@0 | 10 | * but without the parent nsIDOMWindow parameter. See nsIPromptService |
michael@0 | 11 | * for all documentation. |
michael@0 | 12 | * |
michael@0 | 13 | * Accesskeys can be attached to buttons and checkboxes by inserting |
michael@0 | 14 | * an & before the accesskey character. For a real &, use && instead. |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | #include "nsISupports.idl" |
michael@0 | 18 | |
michael@0 | 19 | [scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)] |
michael@0 | 20 | interface nsIPrompt : nsISupports |
michael@0 | 21 | { |
michael@0 | 22 | void alert(in wstring dialogTitle, |
michael@0 | 23 | in wstring text); |
michael@0 | 24 | |
michael@0 | 25 | void alertCheck(in wstring dialogTitle, |
michael@0 | 26 | in wstring text, |
michael@0 | 27 | in wstring checkMsg, |
michael@0 | 28 | inout boolean checkValue); |
michael@0 | 29 | |
michael@0 | 30 | boolean confirm(in wstring dialogTitle, |
michael@0 | 31 | in wstring text); |
michael@0 | 32 | |
michael@0 | 33 | boolean confirmCheck(in wstring dialogTitle, |
michael@0 | 34 | in wstring text, |
michael@0 | 35 | in wstring checkMsg, |
michael@0 | 36 | inout boolean checkValue); |
michael@0 | 37 | |
michael@0 | 38 | const unsigned long BUTTON_POS_0 = 1; |
michael@0 | 39 | const unsigned long BUTTON_POS_1 = 1 << 8; |
michael@0 | 40 | const unsigned long BUTTON_POS_2 = 1 << 16; |
michael@0 | 41 | |
michael@0 | 42 | const unsigned long BUTTON_TITLE_OK = 1; |
michael@0 | 43 | const unsigned long BUTTON_TITLE_CANCEL = 2; |
michael@0 | 44 | const unsigned long BUTTON_TITLE_YES = 3; |
michael@0 | 45 | const unsigned long BUTTON_TITLE_NO = 4; |
michael@0 | 46 | const unsigned long BUTTON_TITLE_SAVE = 5; |
michael@0 | 47 | const unsigned long BUTTON_TITLE_DONT_SAVE = 6; |
michael@0 | 48 | const unsigned long BUTTON_TITLE_REVERT = 7; |
michael@0 | 49 | |
michael@0 | 50 | const unsigned long BUTTON_TITLE_IS_STRING = 127; |
michael@0 | 51 | |
michael@0 | 52 | const unsigned long BUTTON_POS_0_DEFAULT = 0 << 24; |
michael@0 | 53 | const unsigned long BUTTON_POS_1_DEFAULT = 1 << 24; |
michael@0 | 54 | const unsigned long BUTTON_POS_2_DEFAULT = 2 << 24; |
michael@0 | 55 | |
michael@0 | 56 | /* used for security dialogs, buttons are initially disabled */ |
michael@0 | 57 | const unsigned long BUTTON_DELAY_ENABLE = 1 << 26; |
michael@0 | 58 | |
michael@0 | 59 | const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) + |
michael@0 | 60 | (BUTTON_TITLE_CANCEL * BUTTON_POS_1); |
michael@0 | 61 | const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) + |
michael@0 | 62 | (BUTTON_TITLE_NO * BUTTON_POS_1); |
michael@0 | 63 | |
michael@0 | 64 | int32_t confirmEx(in wstring dialogTitle, |
michael@0 | 65 | in wstring text, |
michael@0 | 66 | in unsigned long buttonFlags, |
michael@0 | 67 | in wstring button0Title, |
michael@0 | 68 | in wstring button1Title, |
michael@0 | 69 | in wstring button2Title, |
michael@0 | 70 | in wstring checkMsg, |
michael@0 | 71 | inout boolean checkValue); |
michael@0 | 72 | |
michael@0 | 73 | boolean prompt(in wstring dialogTitle, |
michael@0 | 74 | in wstring text, |
michael@0 | 75 | inout wstring value, |
michael@0 | 76 | in wstring checkMsg, |
michael@0 | 77 | inout boolean checkValue); |
michael@0 | 78 | |
michael@0 | 79 | boolean promptPassword(in wstring dialogTitle, |
michael@0 | 80 | in wstring text, |
michael@0 | 81 | inout wstring password, |
michael@0 | 82 | in wstring checkMsg, |
michael@0 | 83 | inout boolean checkValue); |
michael@0 | 84 | |
michael@0 | 85 | boolean promptUsernameAndPassword(in wstring dialogTitle, |
michael@0 | 86 | in wstring text, |
michael@0 | 87 | inout wstring username, |
michael@0 | 88 | inout wstring password, |
michael@0 | 89 | in wstring checkMsg, |
michael@0 | 90 | inout boolean checkValue); |
michael@0 | 91 | |
michael@0 | 92 | boolean select(in wstring dialogTitle, |
michael@0 | 93 | in wstring text, |
michael@0 | 94 | in uint32_t count, |
michael@0 | 95 | [array, size_is(count)] in wstring selectList, |
michael@0 | 96 | out long outSelection); |
michael@0 | 97 | }; |