chrome: Show non-CefBrowserView browser windows on creation (see issue #2969)

Browser windows created via CefBrowserHost::CreateBrowser should be shown at
creation time. These windows receive default Chromium styling, unlike
CefBrowserView windows which may contain other client-specified Views and
where show state can be configured via CefWindowDelegate::GetInitialShowState
or by calling CefWindow::Show.
This commit is contained in:
Marshall Greenblatt 2021-11-16 17:24:58 -05:00
parent 8e39ae2703
commit 7f0c88b5da
1 changed files with 9 additions and 2 deletions

View File

@ -117,8 +117,6 @@ void ChromeBrowserHostImpl::AddNewContents(
TabStripModel::ADD_ACTIVE);
SetBrowser(browser);
browser->window()->Show();
}
void ChromeBrowserHostImpl::OnWebContentsDestroyed(
@ -462,15 +460,24 @@ Browser* ChromeBrowserHostImpl::CreateBrowser(
// associated BrowserView.
auto browser = Browser::Create(chrome_params);
bool show_browser = true;
#if defined(TOOLKIT_VIEWS)
if (chrome_browser_view) {
// Initialize the BrowserFrame and BrowserView and create the controls that
// require access to the Browser.
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
params.browser_view);
// Don't show the browser by default.
show_browser = false;
}
#endif
if (show_browser) {
browser->window()->Show();
}
return browser;
}