views: Restore window state when showing window

This commit is contained in:
Cheng Zhao 2015-03-26 16:39:03 +08:00
parent 0611f9156f
commit 83024ea509
2 changed files with 13 additions and 1 deletions

View file

@ -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) {