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