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: Java; tab-width: 2; 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 | // update menu items that rely on focus or on the current selection |
michael@0 | 8 | function goUpdateGlobalEditMenuItems() |
michael@0 | 9 | { |
michael@0 | 10 | // Don't bother updating the edit commands if they aren't visible in any way |
michael@0 | 11 | // (i.e. the Edit menu isn't open, nor is the context menu open, nor have the |
michael@0 | 12 | // cut, copy, and paste buttons been added to the toolbars) for performance. |
michael@0 | 13 | // This only works in applications/on platforms that set the gEditUIVisible |
michael@0 | 14 | // flag, so we check to see if that flag is defined before using it. |
michael@0 | 15 | if (typeof gEditUIVisible != "undefined" && !gEditUIVisible) |
michael@0 | 16 | return; |
michael@0 | 17 | |
michael@0 | 18 | goUpdateCommand("cmd_undo"); |
michael@0 | 19 | goUpdateCommand("cmd_redo"); |
michael@0 | 20 | goUpdateCommand("cmd_cut"); |
michael@0 | 21 | goUpdateCommand("cmd_copy"); |
michael@0 | 22 | goUpdateCommand("cmd_paste"); |
michael@0 | 23 | goUpdateCommand("cmd_selectAll"); |
michael@0 | 24 | goUpdateCommand("cmd_delete"); |
michael@0 | 25 | goUpdateCommand("cmd_switchTextDirection"); |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | // update menu items that relate to undo/redo |
michael@0 | 29 | function goUpdateUndoEditMenuItems() |
michael@0 | 30 | { |
michael@0 | 31 | goUpdateCommand("cmd_undo"); |
michael@0 | 32 | goUpdateCommand("cmd_redo"); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | // update menu items that depend on clipboard contents |
michael@0 | 36 | function goUpdatePasteMenuItems() |
michael@0 | 37 | { |
michael@0 | 38 | goUpdateCommand("cmd_paste"); |
michael@0 | 39 | } |