Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use InvalidateLayout() not DeprecatedLayoutImmediately() #41899

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_browser_window.cc
Expand Up @@ -100,7 +100,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
// Note that |GetContentsView|, confusingly, does not refer to the same thing
// as |BaseWindow::GetContentView|.
window()->GetContentsView()->AddChildViewAt(web_contents_view->view(), 0);
window()->GetContentsView()->DeprecatedLayoutImmediately();
window()->GetContentsView()->InvalidateLayout();

// Init window after everything has been setup.
window()->InitFromOptions(options);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/native_window_mac.mm
Expand Up @@ -365,7 +365,7 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
set_content_view(view);
root_view->AddChildView(content_view());

root_view->DeprecatedLayoutImmediately();
root_view->InvalidateLayout();
}

void NativeWindowMac::Close() {
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/native_window_views.cc
Expand Up @@ -474,7 +474,7 @@ void NativeWindowViews::SetContentView(views::View* view) {
set_content_view(view);
focused_view_ = view;
root_view_.GetMainView()->AddChildView(content_view());
root_view_.GetMainView()->DeprecatedLayoutImmediately();
root_view_.GetMainView()->InvalidateLayout();
}

void NativeWindowViews::Close() {
Expand Down
6 changes: 3 additions & 3 deletions shell/browser/ui/inspectable_web_contents_view.cc
Expand Up @@ -123,7 +123,7 @@ void InspectableWebContentsView::ShowDevTools(bool activate) {
devtools_web_view_->SetWebContents(
inspectable_web_contents_->GetDevToolsWebContents());
devtools_web_view_->RequestFocus();
DeprecatedLayoutImmediately();
InvalidateLayout();
}
}

Expand All @@ -144,7 +144,7 @@ void InspectableWebContentsView::CloseDevTools() {
} else {
devtools_web_view_->SetVisible(false);
devtools_web_view_->SetWebContents(nullptr);
DeprecatedLayoutImmediately();
InvalidateLayout();
}
}

Expand Down Expand Up @@ -193,7 +193,7 @@ void InspectableWebContentsView::SetIsDocked(bool docked, bool activate) {
void InspectableWebContentsView::SetContentsResizingStrategy(
const DevToolsContentsResizingStrategy& strategy) {
strategy_.CopyFrom(strategy);
DeprecatedLayoutImmediately();
InvalidateLayout();
}

void InspectableWebContentsView::SetTitle(const std::u16string& title) {
Expand Down