refactor: make electron::api::BaseWindow fields private (#46689)

refactor: make electron::api::BaseWindow fields private
This commit is contained in:
Charles Kerr 2025-04-22 03:19:11 -05:00 committed by GitHub
parent ac2c0c76fe
commit 7083419361
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -36,7 +36,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
std::string color;
if (options.Get(options::kBackgroundColor, &color)) {
web_preferences.SetHidden(options::kBackgroundColor, color);
} else if (window_->IsTranslucent()) {
} else if (window()->IsTranslucent()) {
// If the BrowserWindow is transparent or a vibrancy type has been set,
// also propagate transparency to the WebContents unless a separate
// backgroundColor has been set.
@ -67,7 +67,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
gin::Handle<WebContentsView> web_contents_view =
WebContentsView::Create(isolate, web_preferences);
DCHECK(web_contents_view.get());
window_->AddDraggableRegionProvider(web_contents_view.get());
window()->AddDraggableRegionProvider(web_contents_view.get());
web_contents_view_.Reset(isolate, web_contents_view.ToV8());
// Save a reference of the WebContents.
@ -209,7 +209,7 @@ void BrowserWindow::UpdateWindowControlsOverlay(
void BrowserWindow::CloseImmediately() {
// Close all child windows before closing current window.
v8::HandleScope handle_scope(isolate());
for (v8::Local<v8::Value> value : child_windows_.Values(isolate())) {
for (v8::Local<v8::Value> value : GetChildWindows()) {
gin::Handle<BrowserWindow> child;
if (gin::ConvertFromV8(isolate(), value, &child) && !child.IsEmpty())
child->window()->CloseImmediately();