Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 1483083003: Set the window state consistently Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index b40444763161530ae3dd02362710a1bae9afdb34..b23248d317ab0ac227cafd0d38eff564fc428f63 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -463,7 +463,14 @@ void NativeWidgetAura::CloseNow() {
}
void NativeWidgetAura::Show() {
- ShowWithWindowState(ui::SHOW_STATE_NORMAL);
+ if (IsMaximized())
+ ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED);
+ else if (IsFullscreen())
+ ShowWithWindowState(ui::SHOW_STATE_FULLSCREEN);
+ else if (IsMinimized())
+ ShowWithWindowState(ui::SHOW_STATE_MINIMIZED);
+ else
+ ShowWithWindowState(ui::SHOW_STATE_NORMAL);
}
void NativeWidgetAura::Hide() {
@@ -480,11 +487,11 @@ void NativeWidgetAura::ShowMaximizedWithBounds(
void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
if (!window_)
return;
-
- if (state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN ||
- state == ui::SHOW_STATE_DOCKED) {
+ if (state == ui::SHOW_STATE_DEFAULT)
+ state = ui::SHOW_STATE_NORMAL;
+ if (state != ui::SHOW_STATE_MINIMIZED)
window_->SetProperty(aura::client::kShowStateKey, state);
- }
+
window_->Show();
if (delegate_->CanActivate()) {
if (state != ui::SHOW_STATE_INACTIVE)
« no previous file with comments | « chrome/browser/chromeos/customization/customization_wallpaper_downloader_browsertest.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698