mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
views: Support configuration of initial window show state
Known issues: - Exiting full-screen mode currently crashes with the Chrome runtime (see issue #3182).
This commit is contained in:
@@ -56,8 +56,6 @@ CefRefPtr<ChromeBrowserHostImpl> ChromeBrowserHostImpl::Create(
|
||||
ChromeBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
CHECK(browser_host);
|
||||
|
||||
browser->window()->Show();
|
||||
|
||||
return browser_host;
|
||||
}
|
||||
|
||||
|
@@ -218,9 +218,15 @@ void CefBrowserPlatformDelegateViews::SendTouchEvent(
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateViews::SendFocusEvent(bool setFocus) {
|
||||
// Will result in a call to WebContents::Focus().
|
||||
if (setFocus && browser_view_->root_view())
|
||||
// Will activate the Widget and result in a call to WebContents::Focus().
|
||||
if (setFocus && browser_view_->root_view()) {
|
||||
if (auto widget = GetWindowWidget()) {
|
||||
// Don't activate a minimized Widget, or it will be shown.
|
||||
if (widget->IsMinimized())
|
||||
return;
|
||||
}
|
||||
browser_view_->root_view()->RequestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
gfx::Point CefBrowserPlatformDelegateViews::GetScreenPoint(
|
||||
|
@@ -276,6 +276,22 @@ void CefWindowView::CreateWidget() {
|
||||
|
||||
SetCanResize(cef_delegate()->CanResize(cef_window));
|
||||
|
||||
const auto show_state = cef_delegate()->GetInitialShowState(cef_window);
|
||||
switch (show_state) {
|
||||
case CEF_SHOW_STATE_NORMAL:
|
||||
params.show_state = ui::SHOW_STATE_NORMAL;
|
||||
break;
|
||||
case CEF_SHOW_STATE_MINIMIZED:
|
||||
params.show_state = ui::SHOW_STATE_MINIMIZED;
|
||||
break;
|
||||
case CEF_SHOW_STATE_MAXIMIZED:
|
||||
params.show_state = ui::SHOW_STATE_MAXIMIZED;
|
||||
break;
|
||||
case CEF_SHOW_STATE_FULLSCREEN:
|
||||
params.show_state = ui::SHOW_STATE_FULLSCREEN;
|
||||
break;
|
||||
}
|
||||
|
||||
bool is_menu = false;
|
||||
bool can_activate_menu = true;
|
||||
CefRefPtr<CefWindow> parent_window = cef_delegate()->GetParentWindow(
|
||||
|
Reference in New Issue
Block a user