2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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 01:35:53 +00: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 04:29:02 +00:00
|
|
|
#include "mozilla/Mutex.h"
|
2000-12-14 23:27:59 +00:00
|
|
|
#include "nsIWebProgressListener.h"
|
2000-02-23 20:07:31 +00:00
|
|
|
#include "nsITimer.h"
|
1999-01-30 00:39:25 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2000-01-26 02:21:42 +00:00
|
|
|
#include "nsXULWindow.h"
|
2012-08-15 18:52:42 +00:00
|
|
|
#include "nsIWidgetListener.h"
|
2014-06-06 02:51:14 +00:00
|
|
|
#include "nsITabParent.h"
|
1998-12-03 01:35:53 +00:00
|
|
|
|
|
|
|
/* Forward declarations.... */
|
1999-06-23 03:29:44 +00:00
|
|
|
class nsIURI;
|
1998-12-03 01:35:53 +00:00
|
|
|
|
2013-10-22 13:27:34 +00:00
|
|
|
struct nsWidgetInitData;
|
|
|
|
|
2012-07-23 14:40:36 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class WebShellWindowTimerCallback;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsWebShellWindow final : public nsXULWindow,
|
2015-03-27 18:52:19 +00:00
|
|
|
public nsIWebProgressListener,
|
|
|
|
public nsIWidgetListener
|
1998-12-03 01:35:53 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-09-02 22:24:24 +00:00
|
|
|
explicit nsWebShellWindow(uint32_t aChromeFlags);
|
1998-12-03 01:35:53 +00:00
|
|
|
|
1999-01-21 07:24:01 +00:00
|
|
|
// nsISupports interface...
|
2005-01-03 22:51:17 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
1998-12-03 01:35:53 +00:00
|
|
|
|
1999-01-21 07:24:01 +00:00
|
|
|
// nsWebShellWindow methods...
|
2009-09-29 02:20:46 +00:00
|
|
|
nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
|
2011-10-14 13:06:39 +00:00
|
|
|
nsIURI* aUrl,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aInitialWidth, int32_t aInitialHeight,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aIsHiddenWindow,
|
2014-06-06 02:51:14 +00:00
|
|
|
nsITabParent *aOpeningTab,
|
2005-02-19 22:42:01 +00:00
|
|
|
nsWidgetInitData& widgetInitData);
|
|
|
|
|
|
|
|
nsresult Toolbar();
|
1998-12-03 01:35:53 +00:00
|
|
|
|
2000-12-14 23:27:59 +00:00
|
|
|
// nsIWebProgressListener
|
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
1999-02-21 21:04:21 +00:00
|
|
|
|
2000-04-11 23:52:50 +00:00
|
|
|
// nsIBaseWindow
|
2015-03-21 16:28:04 +00:00
|
|
|
NS_IMETHOD Destroy() override;
|
1999-08-22 23:52:07 +00:00
|
|
|
|
2012-08-15 18:52:42 +00:00
|
|
|
// nsIWidgetListener
|
2015-03-21 16:28:04 +00: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 12:53:31 +00:00
|
|
|
virtual void UIResolutionChanged() override;
|
2015-06-10 11:13:12 +00:00
|
|
|
virtual void FullscreenChanged(bool aInFullscreen) override;
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void OSToolbarButtonPressed() override;
|
2012-08-15 18:52:42 +00:00
|
|
|
virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIWidget* aRequestBelow, nsIWidget** aActualBelow) override;
|
|
|
|
virtual void WindowActivated() override;
|
|
|
|
virtual void WindowDeactivated() override;
|
2012-08-15 18:52:42 +00:00
|
|
|
|
1998-12-03 01:35:53 +00:00
|
|
|
protected:
|
2012-07-23 14:40:36 +00:00
|
|
|
friend class mozilla::WebShellWindowTimerCallback;
|
1999-07-31 22:48:28 +00:00
|
|
|
|
2005-02-19 22:42:01 +00:00
|
|
|
virtual ~nsWebShellWindow();
|
|
|
|
|
1999-05-27 20:36:15 +00:00
|
|
|
void LoadContentAreas();
|
2011-09-29 06:19:26 +00:00
|
|
|
bool ExecuteCloseHandler();
|
2012-08-22 15:56:38 +00:00
|
|
|
void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
|
1999-02-15 05:38:15 +00:00
|
|
|
|
2000-02-23 20:07:31 +00: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 04:29:02 +00:00
|
|
|
mozilla::Mutex mSPTimerLock;
|
2000-02-23 20:07:31 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
void SetPersistenceTimer(uint32_t aDirtyFlags);
|
2012-07-23 14:40:36 +00:00
|
|
|
void FirePersistenceTimer();
|
1998-12-03 01:35:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-02-04 11:00:41 +00:00
|
|
|
#endif /* nsWebShellWindow_h__ */
|