Fix patched chrome build with enable_cef=false

This commit is contained in:
Marshall Greenblatt
2023-01-23 12:58:40 -05:00
parent 5c4ac32bb9
commit 47d2651ea4
5 changed files with 92 additions and 28 deletions

View File

@@ -379,7 +379,7 @@ index 97f6f59322215..a71571e0d6ce9 100644
// Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
// interface to keep these two classes decoupled and testable.
diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc
index e1b23142611cb..08852ecb7c129 100644
index e1b23142611cb..1c9fb04a163db 100644
--- chrome/browser/ui/views/frame/browser_view_layout.cc
+++ chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -46,6 +46,10 @@
@@ -393,15 +393,17 @@ index e1b23142611cb..08852ecb7c129 100644
using views::View;
using web_modal::ModalDialogHostObserver;
using web_modal::WebContentsModalDialogHost;
@@ -472,6 +476,11 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
@@ -472,6 +476,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) {
int BrowserViewLayout::LayoutToolbar(int top) {
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar");
+#if BUILDFLAG(ENABLE_CEF)
+ if (cef::IsCefView(toolbar_)) {
+ // CEF may take ownership of the toolbar. Early exit to avoid the DCHECK
+ // in LayoutManager::SetViewVisibility().
+ return top;
+ }
+#endif
int browser_view_width = vertical_layout_rect_.width();
bool toolbar_visible = delegate_->IsToolbarVisible();
int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0;