2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-12-03 04:35:53 +03:00
|
|
|
|
|
|
|
#ifndef nsWebShellWindow_h__
|
|
|
|
#define nsWebShellWindow_h__
|
|
|
|
|
Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-04-01 08:29:02 +04:00
|
|
|
#include "mozilla/Mutex.h"
|
2000-12-15 02:27:59 +03:00
|
|
|
#include "nsIWebProgressListener.h"
|
2000-02-23 23:07:31 +03:00
|
|
|
#include "nsITimer.h"
|
1999-01-30 03:39:25 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2000-01-26 05:21:42 +03:00
|
|
|
#include "nsXULWindow.h"
|
2012-08-15 22:52:42 +04:00
|
|
|
#include "nsIWidgetListener.h"
|
2014-06-06 06:51:14 +04:00
|
|
|
#include "nsITabParent.h"
|
1998-12-03 04:35:53 +03:00
|
|
|
|
|
|
|
/* Forward declarations.... */
|
1999-06-23 07:29:44 +04:00
|
|
|
class nsIURI;
|
1998-12-03 04:35:53 +03:00
|
|
|
|
2013-10-22 17:27:34 +04:00
|
|
|
struct nsWidgetInitData;
|
|
|
|
|
2012-07-23 18:40:36 +04:00
|
|
|
namespace mozilla {
|
|
|
|
class WebShellWindowTimerCallback;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsWebShellWindow final : public nsXULWindow,
|
2015-03-27 21:52:19 +03:00
|
|
|
public nsIWebProgressListener,
|
|
|
|
public nsIWidgetListener
|
1998-12-03 04:35:53 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-09-03 02:24:24 +04:00
|
|
|
explicit nsWebShellWindow(uint32_t aChromeFlags);
|
1998-12-03 04:35:53 +03:00
|
|
|
|
1999-01-21 10:24:01 +03:00
|
|
|
// nsISupports interface...
|
2005-01-04 01:51:17 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
1998-12-03 04:35:53 +03:00
|
|
|
|
1999-01-21 10:24:01 +03:00
|
|
|
// nsWebShellWindow methods...
|
2009-09-29 06:20:46 +04:00
|
|
|
nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
|
2011-10-14 17:06:39 +04:00
|
|
|
nsIURI* aUrl,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aInitialWidth, int32_t aInitialHeight,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIsHiddenWindow,
|
2014-06-06 06:51:14 +04:00
|
|
|
nsITabParent *aOpeningTab,
|
2016-10-07 21:59:59 +03:00
|
|
|
mozIDOMWindowProxy *aOpenerWIndow,
|
2005-02-20 01:42:01 +03:00
|
|
|
nsWidgetInitData& widgetInitData);
|
|
|
|
|
|
|
|
nsresult Toolbar();
|
1998-12-03 04:35:53 +03:00
|
|
|
|
2000-12-15 02:27:59 +03:00
|
|
|
// nsIWebProgressListener
|
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
1999-02-22 00:04:21 +03:00
|
|
|
|
2000-04-12 03:52:50 +04:00
|
|
|
// nsIBaseWindow
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD Destroy() override;
|
1999-08-23 03:52:07 +04:00
|
|
|
|
2012-08-15 22:52:42 +04:00
|
|
|
// nsIWidgetListener
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIXULWindow* GetXULWindow() override { return this; }
|
|
|
|
virtual nsIPresShell* GetPresShell() override;
|
|
|
|
virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y) override;
|
|
|
|
virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight) override;
|
|
|
|
virtual bool RequestWindowClose(nsIWidget* aWidget) override;
|
|
|
|
virtual void SizeModeChanged(nsSizeMode sizeMode) override;
|
2016-03-17 15:53:31 +03:00
|
|
|
virtual void UIResolutionChanged() override;
|
2015-06-10 14:13:12 +03:00
|
|
|
virtual void FullscreenChanged(bool aInFullscreen) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void OSToolbarButtonPressed() override;
|
2012-08-15 22:52:42 +04:00
|
|
|
virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIWidget* aRequestBelow, nsIWidget** aActualBelow) override;
|
|
|
|
virtual void WindowActivated() override;
|
|
|
|
virtual void WindowDeactivated() override;
|
2012-08-15 22:52:42 +04:00
|
|
|
|
1998-12-03 04:35:53 +03:00
|
|
|
protected:
|
2012-07-23 18:40:36 +04:00
|
|
|
friend class mozilla::WebShellWindowTimerCallback;
|
1999-08-01 02:48:28 +04:00
|
|
|
|
2005-02-20 01:42:01 +03:00
|
|
|
virtual ~nsWebShellWindow();
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ExecuteCloseHandler();
|
2012-08-22 19:56:38 +04:00
|
|
|
void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
|
1999-02-15 08:38:15 +03:00
|
|
|
|
2000-02-23 23:07:31 +03:00
|
|
|
nsCOMPtr<nsITimer> mSPTimer;
|
Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-04-01 08:29:02 +04:00
|
|
|
mozilla::Mutex mSPTimerLock;
|
2000-02-23 23:07:31 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void SetPersistenceTimer(uint32_t aDirtyFlags);
|
2012-07-23 18:40:36 +04:00
|
|
|
void FirePersistenceTimer();
|
1998-12-03 04:35:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-02-04 14:00:41 +03:00
|
|
|
#endif /* nsWebShellWindow_h__ */
|