mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-19 21:50:42 +01:00
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:
parent
8e39ae2703
commit
7f0c88b5da
@ -117,8 +117,6 @@ void ChromeBrowserHostImpl::AddNewContents(
|
|||||||
TabStripModel::ADD_ACTIVE);
|
TabStripModel::ADD_ACTIVE);
|
||||||
|
|
||||||
SetBrowser(browser);
|
SetBrowser(browser);
|
||||||
|
|
||||||
browser->window()->Show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::OnWebContentsDestroyed(
|
void ChromeBrowserHostImpl::OnWebContentsDestroyed(
|
||||||
@ -462,15 +460,24 @@ Browser* ChromeBrowserHostImpl::CreateBrowser(
|
|||||||
// associated BrowserView.
|
// associated BrowserView.
|
||||||
auto browser = Browser::Create(chrome_params);
|
auto browser = Browser::Create(chrome_params);
|
||||||
|
|
||||||
|
bool show_browser = true;
|
||||||
|
|
||||||
#if defined(TOOLKIT_VIEWS)
|
#if defined(TOOLKIT_VIEWS)
|
||||||
if (chrome_browser_view) {
|
if (chrome_browser_view) {
|
||||||
// Initialize the BrowserFrame and BrowserView and create the controls that
|
// Initialize the BrowserFrame and BrowserView and create the controls that
|
||||||
// require access to the Browser.
|
// require access to the Browser.
|
||||||
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
|
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
|
||||||
params.browser_view);
|
params.browser_view);
|
||||||
|
|
||||||
|
// Don't show the browser by default.
|
||||||
|
show_browser = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (show_browser) {
|
||||||
|
browser->window()->Show();
|
||||||
|
}
|
||||||
|
|
||||||
return browser;
|
return browser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user