refactor: pass views::Widget* into constructors of our TreeHosts and NativeWidgets (#47177)

* refactor: remove unnecessary downcast in MenuViews::PopupAt()

* refactor: pass a views::Widget as an arg to the ElectronDesktopWindowTreeHostLinux ctor

* refactor: pass a views::Widget as an arg to the ElectronDesktopNativeWidgetAura ctor

* refactor: pass a views::Widget as an arg to the ElectronDesktopWindowTreeHostWin ctor

* refactor: create desktop_window_tree_host_ in the ElectronDesktopNativeWidgetAura constructor

* fixup! refactor: create desktop_window_tree_host_ in the ElectronDesktopNativeWidgetAura constructor

fix: tyop
This commit is contained in:
Charles Kerr 2025-05-21 16:02:55 -05:00 committed by GitHub
commit 2e8fc17f07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 22 additions and 18 deletions

View file

@ -27,7 +27,7 @@ void MenuViews::PopupAt(BaseWindow* window,
int positioning_item,
ui::mojom::MenuSourceType source_type,
base::OnceClosure callback) {
auto* native_window = static_cast<NativeWindowViews*>(window->window());
const NativeWindow* native_window = window->window();
if (!native_window)
return;