Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 nsGfxButtonControlFrame_h___
7 #define nsGfxButtonControlFrame_h___
9 #include "mozilla/Attributes.h"
10 #include "nsHTMLButtonControlFrame.h"
11 #include "nsCOMPtr.h"
12 #include "nsIAnonymousContentCreator.h"
14 // Class which implements the input[type=button, reset, submit] and
15 // browse button for input[type=file].
16 // The label for button is specified through generated content
17 // in the ua.css file.
19 class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
20 public nsIAnonymousContentCreator
21 {
22 public:
23 NS_DECL_FRAMEARENA_HELPERS
25 nsGfxButtonControlFrame(nsStyleContext* aContext);
27 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
29 virtual nsresult HandleEvent(nsPresContext* aPresContext,
30 mozilla::WidgetGUIEvent* aEvent,
31 nsEventStatus* aEventStatus) MOZ_OVERRIDE;
33 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
35 #ifdef DEBUG_FRAME_DUMP
36 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
37 #endif
39 NS_DECL_QUERYFRAME
41 // nsIAnonymousContentCreator
42 virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
43 virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
44 uint32_t aFilter) MOZ_OVERRIDE;
45 virtual nsIFrame* CreateFrameFor(nsIContent* aContent) MOZ_OVERRIDE;
47 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
48 nsIAtom* aAttribute,
49 int32_t aModType) MOZ_OVERRIDE;
51 virtual bool IsLeaf() const MOZ_OVERRIDE;
53 virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
55 protected:
56 nsresult GetDefaultLabel(nsXPIDLString& aLabel) const;
58 nsresult GetLabel(nsXPIDLString& aLabel);
60 virtual bool IsInput() MOZ_OVERRIDE { return true; }
61 private:
62 nsCOMPtr<nsIContent> mTextContent;
63 };
66 #endif