editor/libeditor/base/SetDocTitleTxn.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 SetDocTitleTxn_h__
     7 #define SetDocTitleTxn_h__
     9 #include "EditTxn.h"                    // for EditTxn, NS_DECL_EDITTXN
    10 #include "nsString.h"                   // for nsString
    11 #include "nscore.h"                     // for NS_IMETHOD, nsAString, etc
    13 class nsIHTMLEditor;
    15 /**
    16  * A transaction that changes the document's title,
    17  *  which is a text node under the <title> tag in a page's <head> section
    18  * provides default concrete behavior for all nsITransaction methods.
    19  */
    20 class SetDocTitleTxn : public EditTxn
    21 {
    22 public:
    23   /** Initialize the transaction.
    24     * @param aEditor the object providing core editing operations
    25     * @param aValue  the new value for document title
    26     */
    27   NS_IMETHOD Init(nsIHTMLEditor  *aEditor,
    28                   const nsAString *aValue);
    29   SetDocTitleTxn();
    30 private:
    31   nsresult SetDomTitle(const nsAString& aTitle);
    33 public:
    34   NS_DECL_EDITTXN
    36   NS_IMETHOD RedoTransaction();
    37   NS_IMETHOD GetIsTransient(bool *aIsTransient);
    39 protected:
    41   /** the editor that created this transaction */
    42   nsIHTMLEditor*  mEditor;
    44   /** The new title string */
    45   nsString    mValue;
    47   /** The previous title string to use for undo */
    48   nsString    mUndoValue;
    50   /** Set true if we dont' really change the title during Do() */
    51   bool mIsTransient;
    52 };
    54 #endif

mercurial