Bug 1811834 - Clean up nsWidgetInitData. r=cmartin,geckoview-reviewers,calu

Move it to the mozilla::widget namespace.

Use enum classes for transparency, popup type, popup level, etc.

Mostly automated with sed, but there were a few manual changes required
as well in windows code because they relied on Atomic<TransparencyMode>
working (which now doesn't because TransparencyMode is 1 byte instead of
4 bytes).

Differential Revision: https://phabricator.services.mozilla.com/D167537
This commit is contained in:
Emilio Cobos Álvarez
2023-01-23 23:58:41 +00:00
parent fcc5d8d102
commit e3921efc1e
70 changed files with 842 additions and 829 deletions

View File

@@ -2273,11 +2273,11 @@ nsresult nsDocumentViewer::MakeWindow(const nsSize& aSize,
// hierarchy will stand alone. otherwise the view will find its own parent
// widget and "do the right thing" to establish a parent/child widget
// relationship
nsWidgetInitData initData;
nsWidgetInitData* initDataPtr;
widget::InitData initData;
widget::InitData* initDataPtr;
if (!mParentWidget) {
initDataPtr = &initData;
initData.mWindowType = eWindowType_invisible;
initData.mWindowType = widget::WindowType::Invisible;
} else {
initDataPtr = nullptr;
}
@@ -3250,9 +3250,10 @@ bool nsDocumentViewer::ShouldAttachToTopLevel() {
// On windows, in the parent process we also attach, but just to
// chrome items
nsWindowType winType = mParentWidget->WindowType();
if ((winType == eWindowType_toplevel || winType == eWindowType_dialog ||
winType == eWindowType_invisible) &&
auto winType = mParentWidget->GetWindowType();
if ((winType == widget::WindowType::TopLevel ||
winType == widget::WindowType::Dialog ||
winType == widget::WindowType::Invisible) &&
mPresContext->IsChrome()) {
return true;
}