Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
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___ */