/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * 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/. */
namespace mozilla { class PresShell; class AppWindowTimerCallback; class L10nReadyPromiseHandler; namespace dom { class Element;
} // namespace dom namespace widget { struct InitData;
} // namespace widget
} // namespace mozilla
class AppWindow final : public nsIBaseWindow, public nsIInterfaceRequestor, public nsIAppWindow, public nsSupportsWeakReference, public nsIWebProgressListener { friendclass ::nsChromeTreeOwner; friendclass ::nsContentTreeOwner;
public: // The implementation of non-refcounted nsIWidgetListener, which would hold a // strong reference on stack before calling AppWindow's // MOZ_CAN_RUN_SCRIPT methods. class WidgetListenerDelegate final : public nsIWidgetListener { public: explicit WidgetListenerDelegate(AppWindow* aAppWindow)
: mAppWindow(aAppWindow) {}
// Saves window size and positioning values in order to display a very early // skeleton UI. This has to happen before we can reasonably initialize the // xulstore (i.e., before even loading libxul), so they have to use a special // purpose store to do so.
nsresult MaybeSaveEarlyWindowPersistentValues( const LayoutDeviceIntRect& aRect);
// Gets the uri spec and the window element ID for this window.
nsresult GetDocXulStoreKeys(nsString& aUriSpec, nsString& aWindowElementId);
// Enum for the current state of a fullscreen change. // // It is used to ensure that fullscreen change is issued after both // the window state change and the window size change at best effort. // This is needed because some platforms can't guarantee the order // between such two events. // // It's changed in the following way: // +---------------------------+--------------------------------------+ // | | | // | v | // | NotChanging | // | + | // | | FullscreenWillChange | // | v | // | +-----------+ WillChange +------------------+ | // | | WindowResized FullscreenChanged | | // | v v | // | WidgetResized WidgetEnteredFullscreen | // | + or WidgetExitedFullscreen | // | | FullscreenChanged + | // | v WindowResized or | | // +--------+ delayed dispatch | | // v | // +-------------+ // // The delayed dispatch serves as timeout, which is necessary because it's // not even guaranteed that the widget will be resized at all. enumclass FullscreenChangeState : uint8_t { // No current fullscreen change. Any previous change has finished.
NotChanging, // Indicate there is going to be a fullscreen change.
WillChange, // The widget has been resized since WillChange.
WidgetResized, // The widget has entered fullscreen state since WillChange.
WidgetEnteredFullscreen, // The widget has exited fullscreen state since WillChange.
WidgetExitedFullscreen,
};
nsChromeTreeOwner* mChromeTreeOwner;
nsContentTreeOwner* mContentTreeOwner;
nsContentTreeOwner* mPrimaryContentTreeOwner;
nsCOMPtr<nsIWidget> mWindow;
RefPtr<nsDocShell> mDocShell;
nsCOMPtr<nsPIDOMWindowOuter> mDOMWindow;
nsWeakPtr mParentWindow;
nsCOMPtr<nsIPrompt> mPrompter;
nsCOMPtr<nsIAuthPrompt> mAuthPrompter;
nsCOMPtr<nsIXULBrowserWindow> mXULBrowserWindow;
nsCOMPtr<nsIDocShellTreeItem> mPrimaryContentShell;
nsresult mModalStatus;
FullscreenChangeState mFullscreenChangeState; bool mContinueModalLoop; bool mDebuting; // being made visible right now bool mChromeLoaded; // True when chrome has loaded bool mSizingShellFromXUL; // true when in SizeShell() bool mShowAfterLoad; bool mIntrinsicallySized; bool mCenterAfterLoad; bool mIsHiddenWindow; bool mLockedUntilChromeLoad; bool mIgnoreXULSize; bool mIgnoreXULPosition; bool mChromeFlagsFrozen; bool mIgnoreXULSizeMode; // mDestroying is used to prevent reentry into into Destroy(), which can // otherwise happen due to script running as we tear down various things. bool mDestroying; bool mRegistered; // Indicator for whether the client size, instead of the window size, should // be maintained in case of a change in their relation. bool mDominantClientSize;
PersistentAttributes mPersistentAttributesDirty;
PersistentAttributes mPersistentAttributesMask;
uint32_t mChromeFlags;
nsCOMPtr<nsIOpenWindowInfo> mInitialOpenWindowInfo;
nsString mTitle;
// The screen rect of the opener.
mozilla::DesktopIntRect mOpenerScreenRect;
// GetPrimaryBrowserParentSize is called from xpidl methods and we don't have // a good way to annotate those with MOZ_CAN_RUN_SCRIPT yet. It takes no // refcounted args other than "this", and the "this" uses seem ok.
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult
GetPrimaryRemoteTabSize(int32_t* aWidth, int32_t* aHeight);
nsresult GetPrimaryContentShellSize(int32_t* aWidth, int32_t* aHeight);
nsresult SetPrimaryRemoteTabSize(int32_t aWidth, int32_t aHeight); void SizeShellToWithLimit(int32_t aDesiredWidth, int32_t aDesiredHeight,
int32_t shellItemWidth, int32_t shellItemHeight);
nsresult MoveResize(const Maybe<LayoutDeviceIntPoint>& aPosition, const Maybe<LayoutDeviceIntSize>& aSize, bool aRepaint);
nsresult MoveResize(const Maybe<DesktopPoint>& aPosition, const Maybe<DesktopSize>& aSize, bool aRepaint);
nsCOMPtr<nsIXULStore> mLocalStore; bool mIsWidgetInFullscreen = false;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.