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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsWebShellWindow_h__ |
michael@0 | 7 | #define nsWebShellWindow_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Mutex.h" |
michael@0 | 10 | #include "nsIWebProgressListener.h" |
michael@0 | 11 | #include "nsITimer.h" |
michael@0 | 12 | #include "nsCOMPtr.h" |
michael@0 | 13 | #include "nsXULWindow.h" |
michael@0 | 14 | #include "nsIWidgetListener.h" |
michael@0 | 15 | |
michael@0 | 16 | /* Forward declarations.... */ |
michael@0 | 17 | class nsIURI; |
michael@0 | 18 | |
michael@0 | 19 | struct nsWidgetInitData; |
michael@0 | 20 | |
michael@0 | 21 | namespace mozilla { |
michael@0 | 22 | class WebShellWindowTimerCallback; |
michael@0 | 23 | } // namespace mozilla |
michael@0 | 24 | |
michael@0 | 25 | class nsWebShellWindow : public nsXULWindow, |
michael@0 | 26 | public nsIWebProgressListener, |
michael@0 | 27 | public nsIWidgetListener |
michael@0 | 28 | { |
michael@0 | 29 | public: |
michael@0 | 30 | nsWebShellWindow(uint32_t aChromeFlags); |
michael@0 | 31 | |
michael@0 | 32 | // nsISupports interface... |
michael@0 | 33 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 34 | |
michael@0 | 35 | // nsWebShellWindow methods... |
michael@0 | 36 | nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener, |
michael@0 | 37 | nsIURI* aUrl, |
michael@0 | 38 | int32_t aInitialWidth, int32_t aInitialHeight, |
michael@0 | 39 | bool aIsHiddenWindow, |
michael@0 | 40 | nsWidgetInitData& widgetInitData); |
michael@0 | 41 | |
michael@0 | 42 | nsresult Toolbar(); |
michael@0 | 43 | |
michael@0 | 44 | // nsIWebProgressListener |
michael@0 | 45 | NS_DECL_NSIWEBPROGRESSLISTENER |
michael@0 | 46 | |
michael@0 | 47 | // nsIBaseWindow |
michael@0 | 48 | NS_IMETHOD Destroy(); |
michael@0 | 49 | |
michael@0 | 50 | // nsIWidgetListener |
michael@0 | 51 | virtual nsIXULWindow* GetXULWindow() { return this; } |
michael@0 | 52 | virtual nsIPresShell* GetPresShell(); |
michael@0 | 53 | virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y); |
michael@0 | 54 | virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight); |
michael@0 | 55 | virtual bool RequestWindowClose(nsIWidget* aWidget); |
michael@0 | 56 | virtual void SizeModeChanged(nsSizeMode sizeMode); |
michael@0 | 57 | virtual void OSToolbarButtonPressed(); |
michael@0 | 58 | virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement, |
michael@0 | 59 | nsIWidget* aRequestBelow, nsIWidget** aActualBelow); |
michael@0 | 60 | virtual void WindowActivated(); |
michael@0 | 61 | virtual void WindowDeactivated(); |
michael@0 | 62 | |
michael@0 | 63 | protected: |
michael@0 | 64 | friend class mozilla::WebShellWindowTimerCallback; |
michael@0 | 65 | |
michael@0 | 66 | virtual ~nsWebShellWindow(); |
michael@0 | 67 | |
michael@0 | 68 | void LoadContentAreas(); |
michael@0 | 69 | bool ExecuteCloseHandler(); |
michael@0 | 70 | void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY); |
michael@0 | 71 | |
michael@0 | 72 | nsCOMPtr<nsITimer> mSPTimer; |
michael@0 | 73 | mozilla::Mutex mSPTimerLock; |
michael@0 | 74 | |
michael@0 | 75 | void SetPersistenceTimer(uint32_t aDirtyFlags); |
michael@0 | 76 | void FirePersistenceTimer(); |
michael@0 | 77 | }; |
michael@0 | 78 | |
michael@0 | 79 | |
michael@0 | 80 | #endif /* nsWebShellWindow_h__ */ |