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

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

Issue 1905333004: Corrects NativeWidgetAura state model to not minimize on every restore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index c715a3b36ce61331fa6c9318e7d54317496bb6c9..dfb691397834f239b6e694d656053a8ddaff1c4a 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -355,8 +355,10 @@ void Widget::Init(const InitParams& in_params) {
SetInitialBounds(params.bounds);
if (params.show_state == ui::SHOW_STATE_MAXIMIZED)
Maximize();
- else if (params.show_state == ui::SHOW_STATE_MINIMIZED)
+ else if (params.show_state == ui::SHOW_STATE_MINIMIZED) {
Minimize();
+ saved_show_state_ = ui::SHOW_STATE_MINIMIZED;
+ }
} else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView());
SetInitialBoundsForFramelessWindow(params.bounds);
@@ -606,10 +608,8 @@ void Widget::Show() {
!IsFullscreen()) {
native_widget_->ShowMaximizedWithBounds(initial_restored_bounds_);
} else {
- ui::WindowShowState show_state =
- IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN :
- IsMinimized() ? ui::SHOW_STATE_MINIMIZED : saved_show_state_;
- native_widget_->ShowWithWindowState(show_state);
+ native_widget_->ShowWithWindowState(
+ IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : saved_show_state_);
varkha 2016/04/22 19:06:41 This reverts part of the change from the breaking
}
// |saved_show_state_| only applies the first time the window is shown.
// If we don't reset the value the window may be shown maximized every time
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698