views: Restore window state when showing window
This commit is contained in:
parent
0611f9156f
commit
83024ea509
2 changed files with 13 additions and 1 deletions
|
@ -307,7 +307,7 @@ bool NativeWindowViews::IsFocused() {
|
|||
}
|
||||
|
||||
void NativeWindowViews::Show() {
|
||||
window_->Show();
|
||||
window_->native_widget_private()->ShowWithWindowState(GetRestoredState());
|
||||
}
|
||||
|
||||
void NativeWindowViews::ShowInactive() {
|
||||
|
@ -927,6 +927,15 @@ gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
|
|||
return window_bounds;
|
||||
}
|
||||
|
||||
ui::WindowShowState NativeWindowViews::GetRestoredState() {
|
||||
if (IsMaximized())
|
||||
return ui::SHOW_STATE_MAXIMIZED;
|
||||
if (IsFullscreen())
|
||||
return ui::SHOW_STATE_FULLSCREEN;
|
||||
|
||||
return ui::SHOW_STATE_NORMAL;
|
||||
}
|
||||
|
||||
// static
|
||||
NativeWindow* NativeWindow::Create(content::WebContents* web_contents,
|
||||
const mate::Dictionary& options) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue