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

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

Issue 1489843003: [WIP: Not for review] Simplify and unify widget/window show logic 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..37d863ef0c3c19db66618a898a2dd6c02fed3660 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -463,6 +463,15 @@ void NativeWidgetAura::CloseNow() {
}
void NativeWidgetAura::Show() {
+ /*
+ if (IsMaximized())
+ ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED);
+ else if (IsFullscreen())
+ ShowWithWindowState(ui::SHOW_STATE_FULLSCREEN);
+ else if (IsMinimized())
+ ShowWithWindowState(ui::SHOW_STATE_MINIMIZED);
+ else
+ */
oshima 2015/12/01 23:00:05 This is alternative way to show the window with th
ShowWithWindowState(ui::SHOW_STATE_NORMAL);
}
@@ -480,11 +489,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 | « ui/aura/window_tracker.cc ('k') | ui/views/widget/widget.h » ('j') | ui/views/widget/widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698