layout/xul/nsButtonBoxFrame.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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/. */
     5 #ifndef nsButtonBoxFrame_h___
     6 #define nsButtonBoxFrame_h___
     8 #include "mozilla/Attributes.h"
     9 #include "nsBoxFrame.h"
    11 class nsButtonBoxFrame : public nsBoxFrame
    12 {
    13 public:
    14   NS_DECL_FRAMEARENA_HELPERS
    16   friend nsIFrame* NS_NewButtonBoxFrame(nsIPresShell* aPresShell);
    18   nsButtonBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
    19     :nsBoxFrame(aPresShell, aContext, false) {
    20     UpdateMouseThrough();
    21   }
    23   virtual void BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
    24                                            const nsRect&           aDirtyRect,
    25                                            const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    27   virtual nsresult HandleEvent(nsPresContext* aPresContext, 
    28                                mozilla::WidgetGUIEvent* aEvent,
    29                                nsEventStatus* aEventStatus) MOZ_OVERRIDE;
    31   virtual void MouseClicked(nsPresContext* aPresContext,
    32                             mozilla::WidgetGUIEvent* aEvent)
    33   { DoMouseClick(aEvent, false); }
    35 #ifdef DEBUG_FRAME_DUMP
    36   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
    37     return MakeFrameName(NS_LITERAL_STRING("ButtonBoxFrame"), aResult);
    38   }
    39 #endif
    41   /**
    42    * Our implementation of MouseClicked. 
    43    * @param aTrustEvent if true and aEvent as null, then assume the event was trusted
    44    */
    45   void DoMouseClick(mozilla::WidgetGUIEvent* aEvent, bool aTrustEvent);
    46   void UpdateMouseThrough() MOZ_OVERRIDE { AddStateBits(NS_FRAME_MOUSE_THROUGH_NEVER); }
    47 }; // class nsButtonBoxFrame
    49 #endif /* nsButtonBoxFrame_h___ */

mercurial