From c6cd09985f154e43e61695d76f315fe2e1834697 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 17 Apr 2024 12:28:47 -0500 Subject: [PATCH] refactor: replace DeprecatedLayoutImmediately() calls with InvalidateLayout() Xref: https://crbug.com/1121681 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5242027 --- shell/browser/api/electron_api_browser_window.cc | 2 +- shell/browser/native_window_mac.mm | 2 +- shell/browser/native_window_views.cc | 2 +- shell/browser/ui/inspectable_web_contents_view.cc | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 234dedb643..352029b665 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -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); diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index e9909c0a53..8c0a2858d9 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -365,7 +365,7 @@ void NativeWindowMac::SetContentView(views::View* view) { set_content_view(view); root_view->AddChildView(content_view()); - root_view->DeprecatedLayoutImmediately(); + root_view->InvalidateLayout(); } void NativeWindowMac::Close() { diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 0528acdada..eaff193cef 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -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() { diff --git a/shell/browser/ui/inspectable_web_contents_view.cc b/shell/browser/ui/inspectable_web_contents_view.cc index 411c902fd1..32c134eebe 100644 --- a/shell/browser/ui/inspectable_web_contents_view.cc +++ b/shell/browser/ui/inspectable_web_contents_view.cc @@ -123,7 +123,7 @@ void InspectableWebContentsView::ShowDevTools(bool activate) { devtools_web_view_->SetWebContents( inspectable_web_contents_->GetDevToolsWebContents()); devtools_web_view_->RequestFocus(); - DeprecatedLayoutImmediately(); + InvalidateLayout(); } } @@ -144,7 +144,7 @@ void InspectableWebContentsView::CloseDevTools() { } else { devtools_web_view_->SetVisible(false); devtools_web_view_->SetWebContents(nullptr); - DeprecatedLayoutImmediately(); + InvalidateLayout(); } } @@ -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) {