refactor: simplify NativeWindow-to-BaseWindow lookup (#49520)

refactor: simplify native window to base window lookup
This commit is contained in:
Charles Kerr
2026-01-26 05:28:57 -06:00
committed by GitHub
parent 75be2fe8d6
commit 6766343173
10 changed files with 40 additions and 78 deletions

View File

@@ -96,9 +96,11 @@ gfx::Size GetExpandedWindowSize(const NativeWindow* window,
} // namespace
NativeWindow::NativeWindow(const gin_helper::Dictionary& options,
NativeWindow::NativeWindow(const int32_t base_window_id,
const gin_helper::Dictionary& options,
NativeWindow* parent)
: title_bar_style_{options.ValueOrDefault(options::kTitleBarStyle,
: base_window_id_{base_window_id},
title_bar_style_{options.ValueOrDefault(options::kTitleBarStyle,
TitleBarStyle::kNormal)},
transparent_{options.ValueOrDefault(options::kTransparent, false)},
enable_larger_than_screen_{
@@ -108,6 +110,8 @@ NativeWindow::NativeWindow(const gin_helper::Dictionary& options,
has_frame_{options.ValueOrDefault(options::kFrame, true) &&
title_bar_style_ == TitleBarStyle::kNormal},
parent_{parent} {
DCHECK_NE(base_window_id_, 0);
#if BUILDFLAG(IS_WIN)
options.Get(options::kBackgroundMaterial, &background_material_);
#elif BUILDFLAG(IS_MAC)