editor/libeditor/base/DeleteNodeTxn.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef DeleteNodeTxn_h__
     7 #define DeleteNodeTxn_h__
     9 #include "EditTxn.h"
    10 #include "nsCOMPtr.h"
    11 #include "nsCycleCollectionParticipant.h"
    12 #include "nsIContent.h"
    13 #include "nsINode.h"
    14 #include "nsISupportsImpl.h"
    15 #include "nscore.h"
    17 class nsEditor;
    18 class nsRangeUpdater;
    20 /**
    21  * A transaction that deletes a single element
    22  */
    23 class DeleteNodeTxn : public EditTxn
    24 {
    25 public:
    26   /** initialize the transaction.
    27     * @param aElement the node to delete
    28     */
    29   nsresult Init(nsEditor* aEditor, nsINode* aNode,
    30                 nsRangeUpdater* aRangeUpdater);
    32   DeleteNodeTxn();
    34   NS_DECL_ISUPPORTS_INHERITED
    35   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteNodeTxn, EditTxn)
    37   NS_DECL_EDITTXN
    39   NS_IMETHOD RedoTransaction();
    41 protected:
    43   /** the element to delete */
    44   nsCOMPtr<nsINode> mNode;
    46   /** parent of node to delete */
    47   nsCOMPtr<nsINode> mParent;
    49   /** next sibling to remember for undo/redo purposes */
    50   nsCOMPtr<nsIContent> mRefNode;
    52   /** the editor for this transaction */
    53   nsEditor* mEditor;
    55   /** range updater object */
    56   nsRangeUpdater* mRangeUpdater;
    57 };
    59 #endif

mercurial