Line data Source code
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 :
6 : #ifndef nsWebShellWindow_h__
7 : #define nsWebShellWindow_h__
8 :
9 : #include "mozilla/Mutex.h"
10 : #include "nsIWebProgressListener.h"
11 : #include "nsITimer.h"
12 : #include "nsCOMPtr.h"
13 : #include "nsXULWindow.h"
14 : #include "nsIWidgetListener.h"
15 : #include "nsITabParent.h"
16 :
17 : /* Forward declarations.... */
18 : class nsIURI;
19 :
20 : struct nsWidgetInitData;
21 :
22 : namespace mozilla {
23 : class WebShellWindowTimerCallback;
24 : } // namespace mozilla
25 :
26 : class nsWebShellWindow final : public nsXULWindow,
27 : public nsIWebProgressListener,
28 : public nsIWidgetListener
29 : {
30 : public:
31 : explicit nsWebShellWindow(uint32_t aChromeFlags);
32 :
33 : // nsISupports interface...
34 : NS_DECL_ISUPPORTS_INHERITED
35 :
36 : // nsWebShellWindow methods...
37 : nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
38 : nsIURI* aUrl,
39 : int32_t aInitialWidth, int32_t aInitialHeight,
40 : bool aIsHiddenWindow,
41 : nsITabParent *aOpeningTab,
42 : mozIDOMWindowProxy *aOpenerWIndow,
43 : nsWidgetInitData& widgetInitData);
44 :
45 : nsresult Toolbar();
46 :
47 : // nsIWebProgressListener
48 : NS_DECL_NSIWEBPROGRESSLISTENER
49 :
50 : // nsIBaseWindow
51 : NS_IMETHOD Destroy() override;
52 :
53 : // nsIWidgetListener
54 0 : virtual nsIXULWindow* GetXULWindow() override { return this; }
55 : virtual nsIPresShell* GetPresShell() override;
56 : virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y) override;
57 : virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight) override;
58 : virtual bool RequestWindowClose(nsIWidget* aWidget) override;
59 : virtual void SizeModeChanged(nsSizeMode sizeMode) override;
60 : virtual void UIResolutionChanged() override;
61 : virtual void FullscreenChanged(bool aInFullscreen) override;
62 : virtual void OcclusionStateChanged(bool aIsFullyOccluded) override;
63 : virtual void OSToolbarButtonPressed() override;
64 : virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement,
65 : nsIWidget* aRequestBelow, nsIWidget** aActualBelow) override;
66 : virtual void WindowActivated() override;
67 : virtual void WindowDeactivated() override;
68 :
69 : protected:
70 : friend class mozilla::WebShellWindowTimerCallback;
71 :
72 : virtual ~nsWebShellWindow();
73 :
74 : bool ExecuteCloseHandler();
75 : void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
76 :
77 : nsCOMPtr<nsITimer> mSPTimer;
78 : mozilla::Mutex mSPTimerLock;
79 :
80 : void SetPersistenceTimer(uint32_t aDirtyFlags);
81 : void FirePersistenceTimer();
82 : };
83 :
84 :
85 : #endif /* nsWebShellWindow_h__ */
|